Struct rustdb::pstore::Stash

source ·
pub struct Stash {
    pub time: u64,
    pub pages: FxHashMap<u64, PageInfoPtr>,
    pub rdrs: BTreeMap<u64, usize>,
    pub vers: BTreeMap<u64, FxHashSet<u64>>,
    pub total: i64,
    pub mem_limit: usize,
    pub min: GHeap<u64, u64, u32>,
    pub read: u64,
    pub miss: u64,
}
Expand description

Central store of data.

Fields§

§time: u64

Write time - number of writes.

§pages: FxHashMap<u64, PageInfoPtr>

Page number -> page info.

§rdrs: BTreeMap<u64, usize>

Time -> reader count. Number of readers for given time.

§vers: BTreeMap<u64, FxHashSet<u64>>

Time -> set of page numbers. Page copies held for given time.

§total: i64

Total size of current pages.

§mem_limit: usize

trim_cache reduces total to mem_limit (or below).

§min: GHeap<u64, u64, u32>

Tracks loaded page with smallest usage.

§read: u64

Total number of page accesses.

§miss: u64

Total number of misses ( data was not already loaded ).

Implementations§

source§

impl Stash

source

pub fn cached(&self) -> usize

Return the number of pages currently cached.

Trait Implementations§

source§

impl Default for Stash

source§

fn default() -> Stash

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

Auto Trait Implementations§

§

impl Freeze for Stash

§

impl RefUnwindSafe for Stash

§

impl Send for Stash

§

impl Sync for Stash

§

impl Unpin for Stash

§

impl UnwindSafe for Stash

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.