pub struct BlockManager<B>where
B: Backend,{ /* private fields */ }Expand description
Manages allocation and reuse of physical blocks.
Implementations§
Source§impl<B> BlockManager<B>where
B: Backend,
impl<B> BlockManager<B>where
B: Backend,
pub fn new( max_blocks: usize, num_heads: usize, head_dim: usize, device: <B as Backend>::Device, ) -> BlockManager<B>
pub fn get(&self, block_id: usize) -> Option<&KVBlock<B>>
pub fn get_mut(&mut self, block_id: usize) -> Option<&mut KVBlock<B>>
pub fn num_free_blocks(&self) -> usize
pub fn num_heads(&self) -> usize
pub fn head_dim(&self) -> usize
pub fn device(&self) -> &<B as Backend>::Device
Trait Implementations§
Source§impl<B> Clone for BlockManager<B>
impl<B> Clone for BlockManager<B>
Source§fn clone(&self) -> BlockManager<B>
fn clone(&self) -> BlockManager<B>
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 moreAuto Trait Implementations§
impl<B> Forget for BlockManager<B>
impl<B> Freeze for BlockManager<B>
impl<B> RefUnwindSafe for BlockManager<B>
impl<B> Send for BlockManager<B>
impl<B> Sync for BlockManager<B>
impl<B> Unpin for BlockManager<B>
impl<B> UnsafeUnpin for BlockManager<B>
impl<B> UnwindSafe for BlockManager<B>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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