pub struct SerializableHttpResponse { /* private fields */ }Expand description
Serialized form of an HTTP response for cache storage.
This type captures all information needed to reconstruct an HTTP response: status code, HTTP version, headers, and body bytes. It supports multiple serialization formats through serde and optionally rkyv for zero-copy deserialization.
§Serialization Formats
- JSON/Bincode: Standard serde serialization via
http_serde - rkyv (feature
rkyv_format): Zero-copy deserialization for maximum performance when reading from cache
§Performance
With the rkyv_format feature enabled:
- HTTP version is stored as a single byte (9, 10, 11, 20, 30)
- Status code is stored as a u16
- Headers are stored as
Vec<(String, Vec<u8>)>for zero-copy access
This allows cache hits to avoid most allocations during deserialization.
Trait Implementations§
Source§impl Clone for SerializableHttpResponse
impl Clone for SerializableHttpResponse
Source§fn clone(&self) -> SerializableHttpResponse
fn clone(&self) -> SerializableHttpResponse
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 SerializableHttpResponse
impl Debug for SerializableHttpResponse
Source§impl<'de> Deserialize<'de> for SerializableHttpResponse
impl<'de> Deserialize<'de> for SerializableHttpResponse
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 SerializableHttpResponse
impl RefUnwindSafe for SerializableHttpResponse
impl Send for SerializableHttpResponse
impl Sync for SerializableHttpResponse
impl Unpin for SerializableHttpResponse
impl UnwindSafe for SerializableHttpResponse
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