#[non_exhaustive]pub struct CachedEntry {
pub status: Option<StatusCode>,
pub headers: HeaderMap,
pub body: CachedBody,
}Expand description
Cached entry which will be stored in the cache store.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: Option<StatusCode>Response status.
headers: HeaderMapResponse headers.
body: CachedBodyResponse body.
*Notice: If the response’s body is streaming, it will be ignored an not cached.
Implementations§
Source§impl CachedEntry
impl CachedEntry
Sourcepub fn new(
status: Option<StatusCode>,
headers: HeaderMap,
body: CachedBody,
) -> Self
pub fn new( status: Option<StatusCode>, headers: HeaderMap, body: CachedBody, ) -> Self
Create a new CachedEntry.
Sourcepub fn status(&self) -> Option<StatusCode>
pub fn status(&self) -> Option<StatusCode>
Get the response status.
Sourcepub fn body(&self) -> &CachedBody
pub fn body(&self) -> &CachedBody
Get the response body.
*Notice: If the response’s body is streaming, it will be ignored an not cached.
Trait Implementations§
Source§impl Clone for CachedEntry
impl Clone for CachedEntry
Source§fn clone(&self) -> CachedEntry
fn clone(&self) -> CachedEntry
Returns a copy 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 moreAuto Trait Implementations§
impl !Freeze for CachedEntry
impl RefUnwindSafe for CachedEntry
impl Send for CachedEntry
impl Sync for CachedEntry
impl Unpin for CachedEntry
impl UnwindSafe for CachedEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)