Skip to main content

Tier

Struct Tier 

Source
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 Tier

Source

pub fn new(max_bytes: u64) -> Tier

Source§

impl<B: Backend> Tier<B>

Source

pub fn alone(max_bytes: u64) -> Tier<B>

Source

pub fn over(disk: Store<B>, max_bytes: u64) -> Tier<B>

Source

pub fn disk(&self) -> Option<&Store<B>>

Source

pub async fn persist(&self) -> Result<Persisted, String>

Every node memory holds that the disk lacks, written, then committed there.

Source

pub fn counters(&self) -> Counters

Source

pub fn max_bytes(&self) -> u64

Source

pub fn set_max_bytes(&self, max_bytes: u64)

Source

pub fn bytes(&self) -> u64

Source

pub fn entries(&self) -> usize

Source

pub fn evictions(&self) -> u64

Source

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

Source

pub fn mark_every(&self) -> usize

Source

pub fn set_mark_every(&self, samples: usize)

Trait Implementations§

Source§

impl Default for Tier

Source§

fn default() -> Tier

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<B = Nothing> !Freeze for Tier<B>

§

impl<B> RefUnwindSafe for Tier<B>

§

impl<B> Send for Tier<B>
where Option<Store<B>>: Send,

§

impl<B> Sync for Tier<B>
where Option<Store<B>>: Sync,

§

impl<B> Unpin for Tier<B>
where Option<Store<B>>: Unpin,

§

impl<B> UnsafeUnpin for Tier<B>

§

impl<B> UnwindSafe for Tier<B>
where Option<Store<B>>: UnwindSafe,

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.