flux_common::cache

Struct QueryCache

Source
pub struct QueryCache<R> {
    entries: FxHashMap<String, QueryVal<R>>,
}

Fields§

§entries: FxHashMap<String, QueryVal<R>>

Implementations§

Source§

impl<R> QueryCache<R>

Source

pub fn new() -> Self

Source

pub fn insert(&mut self, key: String, constr_hash: u64, result: R)

Source

pub fn lookup(&self, key: &String, constr_hash: u64) -> Option<&R>

Source

fn path() -> Result<PathBuf, Error>

Source

fn no_cache_err() -> Error

Source§

impl<R: Debug + Serialize + DeserializeOwned> QueryCache<R>

Source

pub fn save(&self) -> Result<(), Error>

Source

pub fn load() -> Self

Trait Implementations§

Source§

impl<R> Default for QueryCache<R>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<R> Freeze for QueryCache<R>

§

impl<R> RefUnwindSafe for QueryCache<R>
where R: RefUnwindSafe,

§

impl<R> Send for QueryCache<R>
where R: Send,

§

impl<R> Sync for QueryCache<R>
where R: Sync,

§

impl<R> Unpin for QueryCache<R>
where R: Unpin,

§

impl<R> UnwindSafe for QueryCache<R>
where R: 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.