Skip to main content

ResidentTpKvCache

Struct ResidentTpKvCache 

Source
pub struct ResidentTpKvCache { /* private fields */ }

Implementations§

Source§

impl ResidentTpKvCache

Source

pub fn new( ranks: Vec<ResidentTpKvCacheRank>, kv_dim_k: usize, kv_dim_v: usize, k_tok_bytes: usize, v_tok_bytes: usize, capacity: usize, ) -> ResidentTpKvCache

Source

pub fn new_swa( ranks: Vec<ResidentTpKvCacheRank>, kv_dim_k: usize, kv_dim_v: usize, k_tok_bytes: usize, v_tok_bytes: usize, capacity: usize, window: usize, ) -> ResidentTpKvCache

Source

pub fn begin_transaction(&mut self) -> Result<TpKvTransaction, String>

Source

pub fn committed_len(&self) -> usize

Source

pub fn staged_len(&self) -> usize

Source

pub fn capacity(&self) -> usize

Source

pub fn physical_capacity(&self) -> usize

Source

pub fn ring_window(&self) -> Option<usize>

Source

pub fn ring_base(&self) -> Option<usize>

Source

pub fn physical_range( &self, start: usize, end: usize, ) -> Result<Range<usize>, String>

Source

pub fn can_rewind_to(&self, target: usize) -> bool

Source

pub fn kv_dim_k(&self) -> usize

Source

pub fn kv_dim_v(&self) -> usize

Source

pub fn k_tok_bytes(&self) -> usize

Source

pub fn v_tok_bytes(&self) -> usize

Source

pub fn ranks_len(&self) -> usize

Source

pub fn rank(&self, rank: usize) -> Option<&ResidentTpKvCacheRank>

Source

pub fn rank_mut(&mut self, rank: usize) -> Option<&mut ResidentTpKvCacheRank>

Source

pub fn ranks(&self) -> &[ResidentTpKvCacheRank]

Source

pub fn ranks_mut(&mut self) -> &mut [ResidentTpKvCacheRank]

Source

pub fn prepare_grow( &self, target_capacity: usize, rows: usize, ) -> Result<TpKvGrowPlan, String>

Source

pub fn publish_grow(&mut self, plan: TpKvGrowPlan) -> Result<(), String>

Source

pub fn prepare_append( &self, transaction: TpKvTransaction, rows: usize, ) -> Result<TpKvAppendPlan, String>

Source

pub fn peek_append_ring(&self, rows: usize) -> Result<(usize, bool), String>

Read-only peek at the NEXT append’s ring plan: (write_row, would_rebase). The dcw (device-counter) append path uses it to route rebase tokens through the full host path — the in-kernel row (len - base) is only valid for contiguous appends.

Source

pub fn publish_append_rebase( &mut self, plan: TpKvAppendPlan, ) -> Result<(), String>

Source

pub fn publish_append_plan( &mut self, plan: TpKvAppendPlan, ) -> Result<(), String>

Source

pub fn publish_hydration( &mut self, logical_len: usize, resident_start: usize, ) -> Result<(), Box<dyn Error>>

Source

pub fn append_target( &self, transaction: TpKvTransaction, rows: usize, ) -> Result<usize, String>

Source

pub fn publish_append( &mut self, transaction: TpKvTransaction, target: usize, ) -> Result<(), String>

Source

pub fn commit_target( &self, transaction: TpKvTransaction, accepted_rows: usize, ) -> Result<usize, String>

Source

pub fn validate_transaction( &self, transaction: TpKvTransaction, ) -> Result<(), String>

Source

pub fn publish_finalize( &mut self, transaction: TpKvTransaction, target: usize, ) -> Result<(), String>

Source

pub fn rewind_to(&mut self, target: usize) -> Result<(), Box<dyn Error>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.