pub struct Encoder { /* private fields */ }Expand description
A QPACK encoder for one HTTP/3 connection.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new() -> Self
pub fn new() -> Self
A static-table-only encoder: it never writes to the encoder stream and every section has a Required Insert Count of 0.
Sourcepub fn with_dynamic_table(max_capacity: u64) -> Self
pub fn with_dynamic_table(max_capacity: u64) -> Self
An encoder that uses a dynamic table of up to max_capacity bytes, limited further by the
peer’s SETTINGS_QPACK_MAX_TABLE_CAPACITY (see Encoder::set_peer_settings).
Sourcepub fn set_peer_settings(
&mut self,
max_table_capacity: u64,
blocked_streams: u64,
)
pub fn set_peer_settings( &mut self, max_table_capacity: u64, blocked_streams: u64, )
Applies the peer’s SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS. Takes effect only before the first insertion.
Sourcepub fn insert_count(&self) -> u64
pub fn insert_count(&self) -> u64
Number of entries inserted so far.
Sourcepub fn known_received_count(&self) -> u64
pub fn known_received_count(&self) -> u64
Number of inserts the decoder has acknowledged.
Sourcepub fn encode(
&mut self,
stream_id: u64,
fields: &[(&[u8], &[u8])],
out: &mut Vec<u8>,
)
pub fn encode( &mut self, stream_id: u64, fields: &[(&[u8], &[u8])], out: &mut Vec<u8>, )
Encodes a field section for stream_id into out. Field names must already be lowercase.
Sourcepub fn on_decoder_stream(&mut self, data: &[u8]) -> Result<(), Error>
pub fn on_decoder_stream(&mut self, data: &[u8]) -> Result<(), Error>
Processes bytes from the peer’s decoder stream (RFC 9204 4.4).
Sourcepub fn take_encoder_stream(&mut self, out: &mut Vec<u8>)
pub fn take_encoder_stream(&mut self, out: &mut Vec<u8>)
Appends pending encoder-stream instructions to out.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Encoder
impl Freeze for Encoder
impl Move for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
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