pub struct MockKvCacheHandle { /* private fields */ }Expand description
Mock KV cache handle — tracks block metadata without allocating real memory.
Implementations§
Trait Implementations§
Source§impl Debug for MockKvCacheHandle
impl Debug for MockKvCacheHandle
Source§impl KvCacheHandle for MockKvCacheHandle
impl KvCacheHandle for MockKvCacheHandle
Source§fn block_table(&self) -> &BlockTable
fn block_table(&self) -> &BlockTable
Get block table for this cache
Source§fn block_table_mut(&mut self) -> &mut BlockTable
fn block_table_mut(&mut self) -> &mut BlockTable
Get mutable block table (for extending)
Source§fn num_layers(&self) -> usize
fn num_layers(&self) -> usize
Get number of layers cached
Source§fn key_cache(&self, _layer: usize) -> Result<Option<TensorRef>>
fn key_cache(&self, _layer: usize) -> Result<Option<TensorRef>>
Get key cache for specific layer (returns tensor reference)
Source§fn value_cache(&self, _layer: usize) -> Result<Option<TensorRef>>
fn value_cache(&self, _layer: usize) -> Result<Option<TensorRef>>
Get value cache for specific layer
Source§fn clone_handle(&self) -> Result<Arc<dyn KvCacheHandle>>
fn clone_handle(&self) -> Result<Arc<dyn KvCacheHandle>>
Clone handle (creates new reference, not deep copy)
Source§fn stats(&self) -> CacheHandleStats
fn stats(&self) -> CacheHandleStats
Get cache statistics
Source§fn num_tokens(&self) -> usize
fn num_tokens(&self) -> usize
Get number of tokens stored in cache
Source§fn kv_cache(
&self,
layer: usize,
) -> Result<(Option<Arc<dyn TensorLike>>, Option<Arc<dyn TensorLike>>), FerrumError>
fn kv_cache( &self, layer: usize, ) -> Result<(Option<Arc<dyn TensorLike>>, Option<Arc<dyn TensorLike>>), FerrumError>
Get both key and value caches for layer
Auto Trait Implementations§
impl Freeze for MockKvCacheHandle
impl RefUnwindSafe for MockKvCacheHandle
impl Send for MockKvCacheHandle
impl Sync for MockKvCacheHandle
impl Unpin for MockKvCacheHandle
impl UnsafeUnpin for MockKvCacheHandle
impl UnwindSafe for MockKvCacheHandle
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