pub struct BatchEntry(/* private fields */);Expand description
A handle to one entry of a LlamaBatchExt, returned by the add_*
methods and accepted by the set_* methods.
This is the entry’s index in the batch. It is a distinct type because every
other i32 in this module — token ids, sequence ids, positions — is also an
i32, and mixing them up is otherwise a silent error rather than a
compile error.
Implementations§
Source§impl BatchEntry
impl BatchEntry
Sourcepub fn index(self) -> i32
pub fn index(self) -> i32
The entry’s index in the batch, which is also the index to pass to
LlamaContext::get_logits_ith
after processing.
Trait Implementations§
Source§impl Clone for BatchEntry
impl Clone for BatchEntry
impl Copy for BatchEntry
Source§impl Debug for BatchEntry
impl Debug for BatchEntry
impl Eq for BatchEntry
Source§impl From<BatchEntry> for i32
impl From<BatchEntry> for i32
Source§fn from(entry: BatchEntry) -> Self
fn from(entry: BatchEntry) -> Self
Converts to this type from the input type.
Source§impl Hash for BatchEntry
impl Hash for BatchEntry
Source§impl Ord for BatchEntry
impl Ord for BatchEntry
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for BatchEntry
impl PartialEq for BatchEntry
Source§impl PartialOrd for BatchEntry
impl PartialOrd for BatchEntry
impl StructuralPartialEq for BatchEntry
Auto Trait Implementations§
impl Freeze for BatchEntry
impl RefUnwindSafe for BatchEntry
impl Send for BatchEntry
impl Sync for BatchEntry
impl Unpin for BatchEntry
impl UnsafeUnpin for BatchEntry
impl UnwindSafe for BatchEntry
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