pub struct CachePolicy { /* private fields */ }Expand description
Captured snapshot of a request/response exchange.
CachePolicy is the value type that Cache hands to
a CacheStorage backend for storage and
retrieval. To a storage backend it’s an opaque blob: store it,
return it on lookup, and use same_variant_as
to decide whether a new entry replaces an existing one or appends as
a new Vary variant.
Implementations§
Source§impl CachePolicy
impl CachePolicy
Sourcepub fn same_variant_as(&self, other: &Self) -> bool
pub fn same_variant_as(&self, other: &Self) -> bool
True when other would select the same stored variant as self
for the same CacheKey — i.e. both responses
were captured with matching values for every header listed in
Vary. CacheStorage implementations use
this to decide whether a put should replace an existing variant
or append a new one.
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CachePolicy
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnsafeUnpin for CachePolicy
impl UnwindSafe for CachePolicy
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