NoPrefixCaching

Struct NoPrefixCaching 

Source
pub struct NoPrefixCaching;
Expand description

2026-09-26: No-op prefix cache: is_active is false, every lookup is empty, and every insert and eviction reports nothing.

Trait Implementations§

Source§

impl PrefixCache for NoPrefixCaching

Source§

fn is_active(&self) -> bool

2026-09-26: Whether this cache stores blocks and holds references. NoPrefixCaching answers false, and callers then skip the cache’s bookkeeping.
Source§

fn lookup( &self, _tokens: &[u32], _block_size: usize, _session_hash: u64, _adapter_id: u64, ) -> PrefixMatch

2026-09-26: Look up tokens and return the cached KV blocks of the longest matching prefix, taking a reference on each full matched block so it survives eviction until PrefixCache::release. Read more
Source§

fn insert( &self, _tokens: &[u32], _block_table: &[u32], _disk_block_ids: &[u32], _block_size: usize, _matched_tokens: usize, _adapter_id: u64, ) -> InsertAcquired

2026-09-26: Insert a completed prefill’s blocks. Read more
Source§

fn insert_with_snapshot( &self, _tokens: &[u32], _block_table: &[u32], _disk_block_ids: &[u32], _block_size: usize, _snapshot_id: usize, _session_hash: u64, _matched_tokens: usize, _adapter_id: u64, ) -> (Option<usize>, InsertAcquired)

2026-09-26: insert, then register snapshot_id (a snapshot-pool slot) for the whole of tokens, tagged with session_hash. Returns the displaced resident slot for the caller to free, if any, and the insert’s InsertAcquired.
Source§

fn insert_intermediate_snapshot( &self, _tokens: &[u32], _block_table: &[u32], _disk_block_ids: &[u32], _block_size: usize, _snapshot_id: usize, _session_hash: u64, _matched_tokens: usize, _adapter_id: u64, ) -> Option<usize>

2026-09-26: Register snapshot_id for tokens, the sequence up to the snapshot point, tagged with session_hash. Returns the displaced resident slot for the caller to free, if any.
Source§

fn insert_tail_snapshot( &self, _tokens: &[u32], _snapshot_id: usize, _session_hash: u64, _adapter_id: u64, ) -> Vec<usize>

2026-09-26: Register the session’s tail snapshot in the index only. For a nonzero session_hash it replaces the session’s previous tail and tail sibling. Returns the displaced snapshot ids to free.
Source§

fn insert_tail_sibling_snapshot( &self, _tokens: &[u32], _snapshot_id: usize, _session_hash: u64, _adapter_id: u64, ) -> Option<usize>

2026-09-26: Register the tail’s sibling snapshot in the index. Call it after insert_tail_snapshot, which removes the session’s previous sibling. Returns a displaced snapshot id to free, if any.
Source§

fn release(&self, _tokens: &[u32], _block_size: usize, _adapter_id: u64)

2026-09-26: Drop the sequence’s reference on each full block of tokens the cache holds, when the sequence finishes. adapter_id must be the one used at lookup and insert.
Source§

fn release_matched( &self, _tokens: &[u32], _block_size: usize, _matched_tokens: usize, _adapter_id: u64, )

2026-09-26: Drop the references one lookup took: the full blocks of the first matched_tokens tokens and no more, for a caller that rolls back a lookup before any sequence owns its blocks.
Source§

fn evict(&self, _num_blocks: usize) -> EvictedBlocks

2026-09-26: Evict least-recently-used leaves that no sequence holds until at least num_blocks blocks are freed or none is left. A leaf’s partial-suffix block goes with it, so one more block than asked can come back. The caller applies the EvictedBlocks.
Source§

fn evict_snapshot_lru(&self) -> Option<usize>

2026-09-26: Evict one SSM snapshot from the index; returns its slot for the caller to free.
Source§

fn snapshot_count(&self) -> usize

2026-09-26: Number of SSM snapshots in the snapshot index.
Source§

fn stats(&self) -> (usize, usize)

2026-09-26: (entries, cached_blocks). RadixTree stores one block per entry and answers its node count for both.
Source§

fn peek_matched_tokens( &self, _tokens: &[u32], _block_size: usize, _adapter_id: u64, ) -> usize

2026-09-26: The number of tokens lookup would match, without taking references, touching LRU state or counting a hit or miss. Keyed by adapter_id like lookup. The default answers 0.
Source§

fn pin_prefix( &self, _tokens: &[u32], _block_size: usize, _adapter_id: u64, ) -> usize

2026-09-30: Take a reference on each full block of the prefix lookup would match, without the snapshot lookup or a hit or miss count, so eviction skips that prefix until PrefixCache::release_matched with the returned token count. The default pins nothing and answers 0.
Source§

fn evict_snapshot_to_tier(&self, min_tokens: usize) -> Option<TierEvict>

2026-09-26: Pick a resident snapshot to evict: one at least min_tokens deep is marked spilled and stays findable, a shallower one is removed (TierEvict). min_tokens == 0 always spills. None when nothing is resident; the default answers None.
Source§

fn promote_snapshot(&self, key: u64, new_slot: usize) -> bool

2026-09-26: After the caller faulted a spilled snapshot into new_slot, make its entry resident there. false if the key is unknown; the default answers false.
Source§

fn forget_snapshot_tier_key(&self, key: u64) -> bool

2026-09-26: Remove the spilled entry for key, for a caller whose stored bytes for it are gone, so later lookups stop returning it. A resident entry is left alone, since its slot is live. Returns whether an entry was removed; the default answers false.

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more