pub struct HeaderSerde { /* private fields */ }
Expand description
HTTP Response header serialization
This struct provides the APIs to convert HTTP response header into compressed wired format for storage.
Implementations§
Source§impl HeaderSerde
impl HeaderSerde
Sourcepub fn new(dict: Option<Vec<u8>>) -> Self
pub fn new(dict: Option<Vec<u8>>) -> Self
Create a new HeaderSerde
An optional zstd compression dictionary can be provided to improve the compression ratio and speed. See dict for more details.
Sourcepub fn serialize(&self, header: &ResponseHeader) -> Result<Vec<u8>>
pub fn serialize(&self, header: &ResponseHeader) -> Result<Vec<u8>>
Serialize the given response header
Sourcepub fn deserialize(&self, data: &[u8]) -> Result<ResponseHeader>
pub fn deserialize(&self, data: &[u8]) -> Result<ResponseHeader>
Deserialize the given response header
Auto Trait Implementations§
impl !Freeze for HeaderSerde
impl RefUnwindSafe for HeaderSerde
impl Send for HeaderSerde
impl Sync for HeaderSerde
impl Unpin for HeaderSerde
impl UnwindSafe for HeaderSerde
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