pub struct CacheEntry {
pub status: StatusCode,
pub version: Version,
pub headers: Vec<(String, Vec<u8>)>,
pub body: Bytes,
pub tags: Option<Vec<String>>,
}Expand description
Cached response payload captured by the cache layer.
Fields§
§status: StatusCode§version: Version§headers: Vec<(String, Vec<u8>)>§body: BytesImplementations§
Source§impl CacheEntry
impl CacheEntry
Sourcepub fn new(
status: StatusCode,
version: Version,
headers: Vec<(String, Vec<u8>)>,
body: Bytes,
) -> Self
pub fn new( status: StatusCode, version: Version, headers: Vec<(String, Vec<u8>)>, body: Bytes, ) -> Self
Creates a new cached response entry.
The entry captures the response status, HTTP version, a serialized subset of headers, and the collected response body.
Creates a new cached response entry with tags.
Sourcepub fn into_response(self) -> Response<SyncBoxBody>
pub fn into_response(self) -> Response<SyncBoxBody>
Converts the entry back into an http::Response.
Trait Implementations§
Source§impl Clone for CacheEntry
impl Clone for CacheEntry
Source§fn clone(&self) -> CacheEntry
fn clone(&self) -> CacheEntry
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 Debug for CacheEntry
impl Debug for CacheEntry
Source§impl<'de> Deserialize<'de> for CacheEntry
impl<'de> Deserialize<'de> for CacheEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for CacheEntry
impl RefUnwindSafe for CacheEntry
impl Send for CacheEntry
impl Sync for CacheEntry
impl Unpin for CacheEntry
impl UnwindSafe for CacheEntry
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