pub struct KvContext {
pub operation: String,
pub layer: Option<usize>,
pub position: Option<usize>,
pub sequence_length: Option<usize>,
}Expand description
KV cache operation context for better error reporting.
Fields§
§operation: String§layer: Option<usize>§position: Option<usize>§sequence_length: Option<usize>Implementations§
Source§impl KvContext
impl KvContext
pub fn new(operation: impl Into<String>) -> Self
pub fn with_layer(self, layer: usize) -> Self
pub fn with_position(self, position: usize) -> Self
pub fn with_sequence_length(self, length: usize) -> Self
pub fn dimension_error(&self, expected: usize, actual: usize) -> KvError
pub fn out_of_bounds_error( &self, index: usize, total: usize, is_layer: bool, ) -> KvError
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KvContext
impl RefUnwindSafe for KvContext
impl Send for KvContext
impl Sync for KvContext
impl Unpin for KvContext
impl UnsafeUnpin for KvContext
impl UnwindSafe for KvContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more