pub struct Cache { /* private fields */ }Expand description
A named W3C Cache storing request/response pairs.
Implementations§
Source§impl Cache
impl Cache
pub fn new() -> Cache
Sourcepub fn match_url(&self, url: &str) -> Option<Response>
pub fn match_url(&self, url: &str) -> Option<Response>
Retrieves a fresh cached Response for the specified URL, if valid.
Sourcepub fn put(&self, url: &str, response: Response) -> Result<bool, FetchError>
pub fn put(&self, url: &str, response: Response) -> Result<bool, FetchError>
Stores a response in the cache, respecting Cache-Control directives (no-store, no-cache, max-age).
Trait Implementations§
Auto Trait Implementations§
impl Forget for Cache
impl Freeze for Cache
impl Move 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