Struct salvo_cache::CachedEntry
source · #[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 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