Struct llm_chain::tokens::TokenCollection
source · pub struct TokenCollection(_);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§
Auto Trait Implementations§
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