pub struct RedisCache {
pub client: Client,
}
Fields§
§client: Client
Trait Implementations§
Source§impl Cache for RedisCache
impl Cache for RedisCache
type Item = String
type Client = Connection
Source§async fn get(&self, id: Self::Item) -> Option<String>
async fn get(&self, id: Self::Item) -> Option<String>
Get a cache object by its identifier Read more
Source§async fn set(&self, id: Self::Item, content: Self::Item) -> bool
async fn set(&self, id: Self::Item, content: Self::Item) -> bool
Set a cache object by its identifier and content Read more
Source§async fn update(&self, id: Self::Item, content: Self::Item) -> bool
async fn update(&self, id: Self::Item, content: Self::Item) -> bool
Update a cache object by its identifier and content Read more
Source§async fn remove(&self, id: Self::Item) -> bool
async fn remove(&self, id: Self::Item) -> bool
Remove a cache object by its identifier Read more
Source§async fn remove_starting_with(&self, id: Self::Item) -> bool
async fn remove_starting_with(&self, id: Self::Item) -> bool
Remove a cache object by its identifier(’s start) Read more
Source§async fn incr(&self, id: Self::Item) -> bool
async fn incr(&self, id: Self::Item) -> bool
Increment a cache object by its identifier Read more
Source§async fn decr(&self, id: Self::Item) -> bool
async fn decr(&self, id: Self::Item) -> bool
Decrement a cache object by its identifier Read more
Source§async fn get_timed<T: Serialize + DeserializeOwned>(
&self,
id: Self::Item,
) -> Option<TimedObject<T>>
async fn get_timed<T: Serialize + DeserializeOwned>( &self, id: Self::Item, ) -> Option<TimedObject<T>>
Get a cache object by its identifier Read more
Source§impl Clone for RedisCache
impl Clone for RedisCache
Source§fn clone(&self) -> RedisCache
fn clone(&self) -> RedisCache
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RedisCache
impl RefUnwindSafe for RedisCache
impl Send for RedisCache
impl Sync for RedisCache
impl Unpin for RedisCache
impl UnwindSafe for RedisCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more