pub struct Cache { /* private fields */ }
Implementations§
source§impl Cache
impl Cache
pub fn new_cache<KVS: KeyValueStore + 'static>( location: PathBuf, ttl: Option<u64>, ) -> Result<Self, Error>
pub fn clear(&mut self) -> Result<(), Error>
pub fn delete(&mut self, key: &[u8]) -> Result<(), Error>
pub fn get(&mut self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
pub fn set(&mut self, key: &[u8], value: &[u8]) -> Result<(), Error>
Trait Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)