Struct DumbCacheSource

Source
pub struct DumbCacheSource<T: 'static + Send + Sync>(/* private fields */);

Implementations§

Source§

impl<T: 'static + Send + Sync> DumbCacheSource<T>

Source

pub fn new() -> DumbCacheSource<T>

Trait Implementations§

Source§

impl<T: 'static + Send + Sync> CacheSource for DumbCacheSource<T>

Source§

type Value = T

Source§

fn load(&self, _id: &str, _create: bool) -> Result<T>

Create a new cached object. Return a value defined by default configurations if create is set. In the course of creation, no state should be stored out of RAM, e.g., writing to files or calling to remote machines.
Source§

fn unload(&self, _id: &str, _obj: &Self::Value) -> Result<()>

Unload a cached object. Implementations should write the value into a recoverable form of storage, e.g., serializing data into JSON, if necessary. Cache unloading is an optional process.
Source§

fn remove(&self, _id: &str) -> Result<()>

Remove a cached object. Implementations should remove any associated data from storage and invalidate any recoverability. If a resource doesn’t exist, the source shouldn’t report an error. Cache removal is an optional process.

Auto Trait Implementations§

§

impl<T> Freeze for DumbCacheSource<T>

§

impl<T> RefUnwindSafe for DumbCacheSource<T>
where T: RefUnwindSafe,

§

impl<T> Send for DumbCacheSource<T>

§

impl<T> Sync for DumbCacheSource<T>

§

impl<T> Unpin for DumbCacheSource<T>
where T: Unpin,

§

impl<T> UnwindSafe for DumbCacheSource<T>
where T: 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.