pub struct DbCache<DBC>where
DBC: DbCommands + 'static,{ /* private fields */ }
Implementations§
Source§impl<DBC> DbCache<DBC>where
DBC: DbCommands + 'static,
impl<DBC> DbCache<DBC>where
DBC: DbCommands + 'static,
pub fn build( cache_manager: &mut CacheManager, config: DbCacheConfig, db_pool: Pool<DBC::Db>, ) -> Arc<DbCache<DBC>>
pub async fn get(&self, key: &DBC::Key) -> Option<DBC::Value>
pub async fn put( &self, key: DBC::Key, value: DBC::Value, ) -> Result<(), GenericError>
pub fn remove(&self, key: &DBC::Key)
pub fn cache(&self) -> &DashMap<DBC::Key, DBC::Value>
Trait Implementations§
Source§impl<DBC> CacheInvalidator for DbCache<DBC>where
DBC: DbCommands,
impl<DBC> CacheInvalidator for DbCache<DBC>where
DBC: DbCommands,
Auto Trait Implementations§
impl<DBC> Freeze for DbCache<DBC>
impl<DBC> !RefUnwindSafe for DbCache<DBC>
impl<DBC> Send for DbCache<DBC>
impl<DBC> Sync for DbCache<DBC>
impl<DBC> Unpin for DbCache<DBC>where
DBC: Unpin,
impl<DBC> !UnwindSafe for DbCache<DBC>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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