#[repr(C)]pub struct HpackContext {
pub dynamics: VecDeque<DynamicHeader>,
/* private fields */
}Expand description
HpackContext contains the state, namely dynamic table and capacity setting, for either the transmitting or receiving part of a connection.
Fields§
§dynamics: VecDeque<DynamicHeader>Implementations§
Source§impl HpackContext
impl HpackContext
Sourcepub fn new() -> HpackContext
pub fn new() -> HpackContext
Instantiate an HpackContext with the specification’s default dynamic table capacity of 4,096 octets.
Sourcepub fn with_capacity(size: u32) -> HpackContext
pub fn with_capacity(size: u32) -> HpackContext
Instantiate an HpackContext with a dynamic table capacity of the given number of octets.
Sourcepub fn capacity(&self) -> u32
pub fn capacity(&self) -> u32
The number of octets, with HPACK-specified overhead included, that the dynamic table can hold.
Sourcepub fn used(&self) -> u32
pub fn used(&self) -> u32
The number of octets, with HPACK-specified overhead included, that are used by the dynamic table.
Sourcepub fn set_capacity(&mut self, value: u32)
pub fn set_capacity(&mut self, value: u32)
Set the dynamic table’s capacity to the number of HPACK-specified octets given. The value given must be from a SETTINGS frame.
Headers will be evicted from the dynamic table as necessary.
pub fn settings_capacity(&self) -> u32
Sourcepub fn resize(&mut self, value: u32) -> Result<(), HpackDecodeError>
pub fn resize(&mut self, value: u32) -> Result<(), HpackDecodeError>
Resize the dynamic table’s size to the number of HPACK-specified octets given.
Headers will be evicted from the dynamic table as necessary.
Sourcepub fn insert(&mut self, name: &[u8], value: &[u8]) -> bool
pub fn insert(&mut self, name: &[u8], value: &[u8]) -> bool
Insert a header into the dynamic table.
If the given header exceeds the dynamic table’s size, the insert may only clear the dynamic table without being added. The returned bool indicates whether the header was added or not.
If it was added, it now occupies the first dynamic index.
Sourcepub fn header_by_index(&self, idx: usize) -> Option<(&[u8], &[u8])>
pub fn header_by_index(&self, idx: usize) -> Option<(&[u8], &[u8])>
Look up a header by a client’s index value.
Sourcepub fn header_name_by_index(&self, idx: usize) -> Option<&[u8]>
pub fn header_name_by_index(&self, idx: usize) -> Option<&[u8]>
Look up a header name by a client’s index value.