pub struct Cache { /* private fields */ }Expand description
Main cache manager handling multiple cache objects
Implementations§
Source§impl Cache
impl Cache
Sourcepub fn new(config: CacheConfig) -> CacheResult<Self>
pub fn new(config: CacheConfig) -> CacheResult<Self>
Sourcepub fn create(
&mut self,
name: &str,
custom_config: Option<&str>,
) -> CacheResult<CacheObject>
pub fn create( &mut self, name: &str, custom_config: Option<&str>, ) -> CacheResult<CacheObject>
Sourcepub fn get(&self, name: &str) -> CacheResult<CacheObject>
pub fn get(&self, name: &str) -> CacheResult<CacheObject>
Sourcepub fn remove(&mut self, name: &str) -> CacheResult<()>
pub fn remove(&mut self, name: &str) -> CacheResult<()>
Sourcepub fn clear(&mut self) -> CacheResult<()>
pub fn clear(&mut self) -> CacheResult<()>
Sourcepub fn set_config(&mut self, config: CacheConfig)
pub fn set_config(&mut self, config: CacheConfig)
Sourcepub fn get_config(&self) -> CacheConfig
pub fn get_config(&self) -> CacheConfig
Sourcepub fn iter(&self) -> impl Iterator<Item = &CacheObject>
pub fn iter(&self) -> impl Iterator<Item = &CacheObject>
Returns iterator over all cache objects
§Returns
impl Iterator<Item = &CacheObject> - Iterator over cache objects
Auto Trait Implementations§
impl Freeze for Cache
impl RefUnwindSafe for Cache
impl Send for Cache
impl Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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