pub struct CacheDB {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl CacheDB
impl CacheDB
pub async fn new() -> CacheDB
pub async fn get_con(&self) -> Connection
Sourcepub async fn set<I>(&self, id: String, content: I) -> boolwhere
I: ToRedisArgs,
pub async fn set<I>(&self, id: String, content: I) -> boolwhere
I: ToRedisArgs,
Set a cache object by its identifier and content
§Arguments:
id
-String
of the object’s idcontent
-String
of the object’s content
Sourcepub async fn update<I>(&self, id: String, content: I) -> boolwhere
I: ToRedisArgs,
pub async fn update<I>(&self, id: String, content: I) -> boolwhere
I: ToRedisArgs,
Update a cache object by its identifier and content
§Arguments:
id
-String
of the object’s idcontent
-String
of the object’s content
Sourcepub async fn remove_starting_with<I>(&self, id: I) -> boolwhere
I: ToRedisArgs,
pub async fn remove_starting_with<I>(&self, id: I) -> boolwhere
I: ToRedisArgs,
Remove a cache object by its identifier(’s start)
§Arguments:
id
-String
of the object’s id(’s start)
Sourcepub async fn get_timed<T, I>(&self, id: I) -> Option<TimedObject<T>>where
T: Serialize + DeserializeOwned,
I: ToRedisArgs,
pub async fn get_timed<T, I>(&self, id: I) -> Option<TimedObject<T>>where
T: Serialize + DeserializeOwned,
I: ToRedisArgs,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CacheDB
impl RefUnwindSafe for CacheDB
impl Send for CacheDB
impl Sync for CacheDB
impl Unpin for CacheDB
impl UnwindSafe for CacheDB
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