pub struct Decoder { /* private fields */ }Expand description
Decodes header blocks, carrying the dynamic table between them.
One decoder per connection, never one per message: the table is connection state, and a fresh decoder for each response would resolve every index the server sent against an empty table.
Implementations§
Source§impl Decoder
impl Decoder
pub fn new(table_size: usize) -> Self
pub fn table(&self) -> &DynamicTable
Sourcepub fn decode(
&mut self,
input: &[u8],
on_header: impl FnMut(&str, &str),
) -> Result<(), Error>
pub fn decode( &mut self, input: &[u8], on_header: impl FnMut(&str, &str), ) -> Result<(), Error>
Decode a complete header block, calling on_header for each field.
A callback rather than a returned collection: a response’s headers do not all need to be held at once, and the caller usually wants two of them.
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
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