Struct nahpack::HpackContext
[−]
[src]
#[repr(C)]pub struct HpackContext { pub dynamics: VecDeque<DynamicHeader>, // some fields omitted }
HpackContext contains the state, namely dynamic table and capacity setting, for either the transmitting or receiving part of a connection.
Fields
dynamics: VecDeque<DynamicHeader>
Methods
impl HpackContext
[src]
fn new() -> HpackContext
Instantiate an HpackContext with the specification's default dynamic table capacity of 4,096 octets.
fn with_capacity(size: u32) -> HpackContext
Instantiate an HpackContext with a dynamic table capacity of the given number of octets.
fn len(&self) -> usize
Number of headers in the context, both static and dynamic.
fn capacity(&self) -> u32
The number of octets, with HPACK-specified overhead included, that the dynamic table can hold.
fn used(&self) -> u32
The number of octets, with HPACK-specified overhead included, that are used by the dynamic table.
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.
fn settings_capacity(&self) -> u32
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.
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.
fn header_by_index(&self, idx: usize) -> Option<(&[u8], &[u8])>
Look up a header by a client's index value.
fn header_name_by_index(&self, idx: usize) -> Option<&[u8]>
Look up a header name by a client's index value.