pub struct NoopCache;Expand description
A simple cache implementation that simply always does nothing.
Trait Implementations§
Source§impl<ErrorT: Error + Sync + Send + Debug> CacheHandler<ErrorT> for NoopCache
impl<ErrorT: Error + Sync + Send + Debug> CacheHandler<ErrorT> for NoopCache
type CachingError = Infallible
Source§fn try_get_cache<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Packet<T>>, Error<ErrorT, Self::CachingError>>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn try_get_cache<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Packet<T>>, Error<ErrorT, Self::CachingError>>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
A method to implement to get a value from the cache
It should NOT return an error if the value is not in the cache
If the value is not in the cache, it should return Ok(None)
Source§fn cache_value<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_: &'life1 str,
__arg2: SuccessPacket<T>,
) -> Pin<Box<dyn Future<Output = Result<(), Error<ErrorT, Self::CachingError>>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cache_value<'life0, 'life1, 'async_trait, T>(
&'life0 self,
_: &'life1 str,
__arg2: SuccessPacket<T>,
) -> Pin<Box<dyn Future<Output = Result<(), Error<ErrorT, Self::CachingError>>> + Send + 'async_trait>>where
T: 'async_trait + DeserializeOwned + Serialize + Send + Sync,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
A method to implement to set a value in the cache
It should return an error if the value could not be set
Auto Trait Implementations§
impl Freeze for NoopCache
impl RefUnwindSafe for NoopCache
impl Send for NoopCache
impl Sync for NoopCache
impl Unpin for NoopCache
impl UnwindSafe for NoopCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more