Struct tokenizers::processors::template::Template
source · pub struct Template(/* private fields */);
Expand description
A Template represents a Vec<Piece
>.
We can easily build one as follows
// By providing a `String` or `&str`, we just split on whitespaces:
let template = Template::try_from("[CLS] $0 [SEP]").unwrap();
// By providing pieces directly:
let template = Template::try_from(vec!["[CLS]", "$0", "[SEP]"]).unwrap();
Both of these methods give the same result.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Template
impl<'de> Deserialize<'de> for Template
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Template
impl PartialEq for Template
impl Eq for Template
impl StructuralPartialEq for Template
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more