pub struct CacheContext {
pub status: CacheStatus,
pub read_mode: ReadMode,
pub source: ResponseSource,
}Expand description
Context information about a cache operation.
Fields§
§status: CacheStatusWhether the request resulted in a cache hit, miss, or stale data.
read_mode: ReadModeRead mode for this operation.
source: ResponseSourceSource of the response.
Implementations§
Source§impl CacheContext
impl CacheContext
Sourcepub fn boxed(self) -> BoxContext
pub fn boxed(self) -> BoxContext
Convert this context into a boxed trait object.
This is a convenience method for creating BoxContext from CacheContext.
Uses SmallBox for inline storage, avoiding heap allocation for small contexts.
Trait Implementations§
Source§impl Clone for CacheContext
impl Clone for CacheContext
Source§fn clone(&self) -> CacheContext
fn clone(&self) -> CacheContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Context for CacheContext
impl Context for CacheContext
Source§fn status(&self) -> CacheStatus
fn status(&self) -> CacheStatus
Returns the cache status.
Source§fn set_status(&mut self, status: CacheStatus)
fn set_status(&mut self, status: CacheStatus)
Sets the cache status.
Source§fn source(&self) -> &ResponseSource
fn source(&self) -> &ResponseSource
Returns the response source.
Source§fn set_source(&mut self, source: ResponseSource)
fn set_source(&mut self, source: ResponseSource)
Sets the response source.
Source§fn set_read_mode(&mut self, mode: ReadMode)
fn set_read_mode(&mut self, mode: ReadMode)
Sets the read mode.
Source§fn clone_box(&self) -> BoxContext
fn clone_box(&self) -> BoxContext
Clone this context into a box.
Source§fn into_cache_context(self: Box<Self>) -> CacheContext
fn into_cache_context(self: Box<Self>) -> CacheContext
Consumes boxed self and returns a
CacheContext.Source§fn merge_from(&mut self, other: &dyn Context, prefix: &BackendLabel)
fn merge_from(&mut self, other: &dyn Context, prefix: &BackendLabel)
Merge fields from another context into this one. Read more
Source§impl Debug for CacheContext
impl Debug for CacheContext
Source§impl Default for CacheContext
impl Default for CacheContext
Source§fn default() -> CacheContext
fn default() -> CacheContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CacheContext
impl RefUnwindSafe for CacheContext
impl Send for CacheContext
impl Sync for CacheContext
impl Unpin for CacheContext
impl UnwindSafe for CacheContext
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