pub struct TokenCollection(/* private fields */);Expand description
A type-safe, enum-backed collection of tokens.
TokenCollection can hold a collection of i32 or usize tokens,
ensuring type safety and efficient storage.
Implementations§
Source§impl TokenCollection
impl TokenCollection
Sourcepub fn as_i32(self) -> Result<Vec<i32>, TokenizerError>
pub fn as_i32(self) -> Result<Vec<i32>, TokenizerError>
Converts the TokenCollection into a vector of i32,
if it contains i32 values. Returns None otherwise.
Trait Implementations§
Source§impl Debug for TokenCollection
impl Debug for TokenCollection
Auto Trait Implementations§
impl Freeze for TokenCollection
impl RefUnwindSafe for TokenCollection
impl Send for TokenCollection
impl Sync for TokenCollection
impl Unpin for TokenCollection
impl UnwindSafe for TokenCollection
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