Trait StateCacheFiller

Source
pub trait StateCacheFiller {
    type Key: Ord;
    type Value;

    // Required methods
    fn capacity(&self) -> Option<usize>;
    fn insert_unchecked(&mut self, key: Self::Key, value: Self::Value);
    fn finish(self);
}

Required Associated Types§

Required Methods§

Source

fn capacity(&self) -> Option<usize>

Get the capacity of the cache.

Source

fn insert_unchecked(&mut self, key: Self::Key, value: Self::Value)

Insert an entry into the cache without cache validity check.

Source

fn finish(self)

Finish syncing the cache with the state table. This should mark the cache as synced.

Implementors§

Source§

impl<K: Ord + EstimateSize, V: EstimateSize> StateCacheFiller for &mut OrderedStateCache<K, V>

Source§

type Key = K

Source§

type Value = V

Source§

impl<K: Ord + EstimateSize, V: EstimateSize> StateCacheFiller for &mut TopNStateCache<K, V>

Source§

type Key = K

Source§

type Value = V