Skip to main content

Tiered

Struct Tiered 

Source
pub struct Tiered<M: Medium> {
    pub front: MemoryCache,
    pub back: Pack<M>,
}
Expand description

The back is a pack and nothing else: store carries no cost, and a pack admits by kind alone, so no back gated on cost can sit here and silently keep nothing.

Fields§

§front: MemoryCache§back: Pack<M>

Implementations§

Source§

impl<M: Medium> Tiered<M>

Source

pub fn new(front: MemoryCache, back: Pack<M>) -> Tiered<M>

Trait Implementations§

Source§

impl<M: Medium> Cache for Tiered<M>

Source§

fn held_bytes(&self) -> u64

Both tiers’ own bytes, summed: a value in both is held twice.

Source§

fn load(&self, key: Hash, node: &str, expected: Expected) -> Option<Entry>

Source§

fn store( &self, key: Hash, payload: &Payload, traces: &[FilterTrace], label: Option<&Label>, )

Source§

fn holds(&self, key: Hash) -> bool

Source§

fn worth_storing(&self, cost: Duration, bytes: usize, kind: PayloadKind) -> bool

Source§

fn sweep(&self)

Source§

fn evicted_bytes(&self) -> u64

Source§

fn faults(&self) -> u64

Source§

fn max_bytes(&self) -> u64

Source§

fn dir(&self) -> Option<&Path>

Auto Trait Implementations§

§

impl<M> !Freeze for Tiered<M>

§

impl<M> !RefUnwindSafe for Tiered<M>

§

impl<M> !Send for Tiered<M>

§

impl<M> !UnwindSafe for Tiered<M>

§

impl<M> Sync for Tiered<M>
where Pack<M>: Sync,

§

impl<M> Unpin for Tiered<M>
where Pack<M>: Unpin,

§

impl<M> UnsafeUnpin for Tiered<M>
where Pack<M>: UnsafeUnpin,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.