pub struct Cache { /* private fields */ }Implementations§
Source§impl Cache
impl Cache
pub async fn new(root: PathBuf) -> Result<Self>
pub fn root(&self) -> &Path
pub async fn get(&self, url: &str, max_age_ms: u64) -> Result<Option<String>>
pub async fn put(&self, url: &str, body: &str) -> Result<()>
pub async fn stats(&self) -> Result<(usize, u64)>
pub async fn clear(&self) -> Result<()>
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 UnsafeUnpin 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