#[repr(transparent)]pub struct LlamaToken(pub llama_token);Expand description
A single vocabulary token id (newtype over ik_llama.cpp’s llama_token = i32).
#[repr(transparent)] guarantees identical layout to llama_token, so
*const llama_token ↔ *const LlamaToken casts (e.g. in mtmd text_tokens)
are sound.
Tuple Fields§
§0: llama_tokenImplementations§
Source§impl LlamaToken
impl LlamaToken
Sourcepub fn new(id: llama_token) -> Self
pub fn new(id: llama_token) -> Self
Construct from a raw token id.
Sourcepub fn raw(self) -> llama_token
pub fn raw(self) -> llama_token
The raw token id.
Trait Implementations§
Source§impl Clone for LlamaToken
impl Clone for LlamaToken
Source§fn clone(&self) -> LlamaToken
fn clone(&self) -> LlamaToken
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LlamaToken
Source§impl Debug for LlamaToken
impl Debug for LlamaToken
impl Eq for LlamaToken
Source§impl Hash for LlamaToken
impl Hash for LlamaToken
Source§impl Ord for LlamaToken
impl Ord for LlamaToken
Source§fn cmp(&self, other: &LlamaToken) -> Ordering
fn cmp(&self, other: &LlamaToken) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LlamaToken
impl PartialEq for LlamaToken
Source§impl PartialOrd for LlamaToken
impl PartialOrd for LlamaToken
impl StructuralPartialEq for LlamaToken
Auto Trait Implementations§
impl Freeze for LlamaToken
impl RefUnwindSafe for LlamaToken
impl Send for LlamaToken
impl Sync for LlamaToken
impl Unpin for LlamaToken
impl UnsafeUnpin for LlamaToken
impl UnwindSafe for LlamaToken
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