pub struct Tier<B = Nothing> { /* private fields */ }Expand description
Memory over a disk, or over nothing. Evaluation talks to memory alone; only memory decides whether a lookup, a read or a write passes through to the disk.
Implementations§
Source§impl<B: Backend> Tier<B>
impl<B: Backend> Tier<B>
pub fn alone(max_bytes: u64) -> Tier<B>
pub fn over(disk: Store<B>, max_bytes: u64) -> Tier<B>
pub fn disk(&self) -> Option<&Store<B>>
Sourcepub async fn persist(&self) -> Result<Persisted, String>
pub async fn persist(&self) -> Result<Persisted, String>
Every node memory holds that the disk lacks, written, then committed there.
pub fn counters(&self) -> Counters
pub fn max_bytes(&self) -> u64
pub fn set_max_bytes(&self, max_bytes: u64)
pub fn bytes(&self) -> u64
pub fn entries(&self) -> usize
pub fn evictions(&self) -> u64
pub fn holds(&self, key: Hash) -> bool
pub fn policy(&self) -> CachePolicy
pub fn set_policy(&self, policy: CachePolicy)
Sourcepub fn prune(&self, policy: PrunePolicy)
pub fn prune(&self, policy: PrunePolicy)
Evicts every entry policy names.
pub fn clear(&self)
pub fn mark_every(&self) -> usize
pub fn set_mark_every(&self, samples: usize)
Trait Implementations§
Auto Trait Implementations§
impl<B = Nothing> !Freeze for Tier<B>
impl<B> RefUnwindSafe for Tier<B>
impl<B> Send for Tier<B>
impl<B> Sync for Tier<B>
impl<B> Unpin for Tier<B>
impl<B> UnsafeUnpin for Tier<B>
impl<B> UnwindSafe for Tier<B>
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