pub struct FileCache { /* private fields */ }Expand description
Keeps cached responses on disk, the same layout the Go SDK uses: etags.json maps
keys to validators and responses/<key>.body holds the bodies. Anything that goes
wrong on disk is treated as a miss.
Implementations§
Trait Implementations§
Source§impl ResponseCache for FileCache
impl ResponseCache for FileCache
Source§fn clear(&self)
fn clear(&self)
Throws away what the cache put in the directory and nothing else. The directory is
shared with hey-cli, which keeps its credentials and its own state alongside, so
only responses/ and etags.json go.
Source§fn set(&self, key: &str, response: CachedResponse)
fn set(&self, key: &str, response: CachedResponse)
Holds a response under
key, replacing whatever was there.Source§fn invalidate(&self, key: &str)
fn invalidate(&self, key: &str)
Forgets what is held under
key.Auto Trait Implementations§
impl !Freeze for FileCache
impl RefUnwindSafe for FileCache
impl Send for FileCache
impl Sync for FileCache
impl Unpin for FileCache
impl UnsafeUnpin for FileCache
impl UnwindSafe for FileCache
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