pub struct TokenInfo {
pub rank: usize,
pub token_bytes: String,
pub token_str: Option<String>,
}Expand description
Information about a vocabulary token.
This struct contains metadata about a single token in the vocabulary, including its rank (position), byte representation, and optional string form.
§Fields
rank- Position of the token in the vocabulary (used as token ID)token_bytes- Base64-encoded byte representation of the tokentoken_str- Optional human-readable string representation
Fields§
§rank: usizeThe position of this token in the vocabulary (used as token ID).
token_bytes: StringBase64-encoded byte representation of the token.
token_str: Option<String>Optional human-readable string representation of the token.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TokenInfo
impl<'de> Deserialize<'de> for TokenInfo
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
Auto Trait Implementations§
impl Freeze for TokenInfo
impl RefUnwindSafe for TokenInfo
impl Send for TokenInfo
impl Sync for TokenInfo
impl Unpin for TokenInfo
impl UnsafeUnpin for TokenInfo
impl UnwindSafe for TokenInfo
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