Struct pond_cache::Cache
source · pub struct Cache { /* private fields */ }Implementations§
source§impl Cache
impl Cache
pub fn new(path: PathBuf) -> Result<Self, Error>
pub fn with_time_to_live(path: PathBuf, ttl: Duration) -> Result<Self, Error>
pub fn get<K, T>(&self, key: K) -> Result<Option<T>, Error>
pub fn store<K, T>(&self, key: K, value: T) -> Result<(), Error>
pub fn store_with_expiration<K, T>( &self, key: K, value: T, expiration: DateTime<Utc> ) -> Result<(), Error>
pub fn clean(&self) -> Result<(), Error>
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