pub struct Pack<M: Medium> { /* private fields */ }Expand description
Records [magic u32][len u32][key 16B][checksum u64][entry], appended and never rewritten
in place except by a sweep. Only samples are kept, as on disk. Opening reads every record,
the later of two under one key winning, and cuts the medium at the first that does not
check out: a torn tail is a miss, never a misread.
Implementations§
Trait Implementations§
Source§impl<M: Medium> Cache for Pack<M>
impl<M: Medium> Cache for Pack<M>
Source§fn held_bytes(&self) -> u64
fn held_bytes(&self) -> u64
The medium’s whole length, records a later one replaced included, until a sweep.
Source§fn worth_storing(
&self,
_cost: Duration,
_bytes: usize,
kind: PayloadKind,
) -> bool
fn worth_storing( &self, _cost: Duration, _bytes: usize, kind: PayloadKind, ) -> bool
No clock enters it: a value a browser renders has no measured cost to weigh.
fn max_bytes(&self) -> u64
fn evicted_bytes(&self) -> u64
fn faults(&self) -> u64
fn holds(&self, key: Hash) -> bool
fn load(&self, key: Hash, node: &str, expected: Expected) -> Option<Entry>
fn store( &self, key: Hash, payload: &Payload, traces: &[FilterTrace], label: Option<&Label>, )
fn sweep(&self)
fn dir(&self) -> Option<&Path>
Auto Trait Implementations§
impl<M> !Freeze for Pack<M>
impl<M> !RefUnwindSafe for Pack<M>
impl<M> !Send for Pack<M>
impl<M> !UnwindSafe for Pack<M>
impl<M> Sync for Pack<M>
impl<M> Unpin for Pack<M>where
M: Unpin,
impl<M> UnsafeUnpin for Pack<M>where
M: UnsafeUnpin,
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