DiscreteFileStoreNonVolatile

Struct DiscreteFileStoreNonVolatile 

Source
pub struct DiscreteFileStoreNonVolatile<Key, Value, Serde>
where Key: Clone + Eq + Hash + Serialize + for<'a> Deserialize<'a>, Value: Serialize + for<'a> Deserialize<'a>, Serde: DiscreteFileSerializerDeserializer<Value>,
{ /* private fields */ }
Expand description

Before using, strongly consider using the volatile version. Do you really need this cache to rehydrate without hitting the source of record? You are sacrificing reboot to clear corruption and now must consider N vs N+1 schema issues when downgrading or upgrading your application.

Implementations§

Source§

impl<Key, Value, Serde> DiscreteFileStoreNonVolatile<Key, Record<Key, Value>, Serde>
where Key: Clone + Eq + Hash + Serialize + for<'a> Deserialize<'a>, Value: Serialize + for<'a> Deserialize<'a>, Serde: DiscreteFileSerializerDeserializer<Record<Key, Value>>,

Source

pub fn new(cache_directory: PathBuf) -> Self

Trait Implementations§

Source§

impl<Key, Value, Serde> CacheStoreStrategy<Key, Value> for DiscreteFileStoreNonVolatile<Key, Record<Key, Value>, Serde>
where Key: Clone + Eq + Hash + Serialize + for<'a> Deserialize<'a>, Value: Serialize + for<'a> Deserialize<'a>, Serde: DiscreteFileSerializerDeserializer<Record<Key, Value>>,

Source§

fn get(&self, key: &Key) -> Option<Value>

Source§

fn peek(&self, key: &Key) -> Option<Value>

A platform read of a value. When replacement strategies are used (e.g. LRU) reads have side effects that update internal tracking. If hydration requires inspecting the current state, these reads will skew tracking. Peek allows you to inspect state without side effects, it signals to any layer that a platform read has occurred that should be ignored for usage tracking purposes. Read more
Source§

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

Source§

fn delete(&mut self, key: &Key) -> bool

Source§

fn flush(&mut self)

Source§

fn get_keys(&self) -> KeyIterator<'_, Key>

Source§

fn contains(&self, key: &Key) -> bool

Auto Trait Implementations§

§

impl<Key, Value, Serde> Freeze for DiscreteFileStoreNonVolatile<Key, Value, Serde>

§

impl<Key, Value, Serde> RefUnwindSafe for DiscreteFileStoreNonVolatile<Key, Value, Serde>
where Serde: RefUnwindSafe, Value: RefUnwindSafe, Key: RefUnwindSafe,

§

impl<Key, Value, Serde> Send for DiscreteFileStoreNonVolatile<Key, Value, Serde>
where Serde: Send, Value: Send, Key: Send,

§

impl<Key, Value, Serde> Sync for DiscreteFileStoreNonVolatile<Key, Value, Serde>
where Serde: Sync, Value: Sync, Key: Sync,

§

impl<Key, Value, Serde> Unpin for DiscreteFileStoreNonVolatile<Key, Value, Serde>
where Serde: Unpin, Value: Unpin, Key: Unpin,

§

impl<Key, Value, Serde> UnwindSafe for DiscreteFileStoreNonVolatile<Key, Value, Serde>
where Key: UnwindSafe, Serde: UnwindSafe, Value: 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 = 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>,

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.