pub struct ScratchPool { /* private fields */ }Implementations§
Source§impl ScratchPool
impl ScratchPool
pub fn new(dims: ScratchDims) -> Result<Self>
pub fn dims(&self) -> ScratchDims
pub fn pool_dev_ptr(&self) -> u64
pub fn slot_dev_ptr(&self, slot: u32) -> u64
pub fn slot_k_ptr(&self, slot: u32, kv_head: u16) -> u64
pub fn slot_v_ptr(&self, slot: u32, kv_head: u16) -> u64
pub fn lookup(&self, key: ResidentKey) -> Option<u32>
Sourcepub fn invalidate(&mut self, key: ResidentKey)
pub fn invalidate(&mut self, key: ResidentKey)
2026-09-25: Free key’s slot, if any, so the next assign of key needs a
fresh read. The offload path calls it after rewriting a block on disk, so
attention does not read the old resident copy.
pub fn capacity(&self) -> u32
pub fn free_count(&self) -> u32
Sourcepub fn assign(
&mut self,
key: ResidentKey,
evict_candidates: &[u32],
) -> Result<u32>
pub fn assign( &mut self, key: ResidentKey, evict_candidates: &[u32], ) -> Result<u32>
2026-09-25: Slot for key: its current slot if resident, else the first free
slot, else the first resident slot in evict_candidates, whose key is evicted.
With no free slot and no resident candidate, an error. The caller fills the
slot.
Sourcepub fn residents(&self) -> Vec<(u32, ResidentKey)>
pub fn residents(&self) -> Vec<(u32, ResidentKey)>
2026-09-25: Every resident slot with its key, in slot order.
pub fn clear(&mut self)
Auto Trait Implementations§
impl Freeze for ScratchPool
impl RefUnwindSafe for ScratchPool
impl Send for ScratchPool
impl Sync for ScratchPool
impl Unpin for ScratchPool
impl UnwindSafe for ScratchPool
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