Struct h2::hpack::table::Table

source ·
pub struct Table {
    mask: usize,
    indices: Vec<Option<Pos>>,
    slots: VecDeque<Slot>,
    inserted: usize,
    size: usize,
    max_size: usize,
}
Expand description

HPACK encoder table

Fields§

§mask: usize§indices: Vec<Option<Pos>>§slots: VecDeque<Slot>§inserted: usize§size: usize§max_size: usize

Implementations§

source§

impl Table

source

pub fn new(max_size: usize, capacity: usize) -> Table

source

pub fn capacity(&self) -> usize

source

pub fn max_size(&self) -> usize

source

pub fn resolve<'a>(&'a self, index: &'a Index) -> &'a Header

Gets the header stored in the table

source

pub fn resolve_idx(&self, index: &Index) -> usize

source

pub fn index(&mut self, header: Header) -> Index

Index the header in the HPACK table.

source

fn index_dynamic( &mut self, header: Header, statik: Option<(usize, bool)> ) -> Index

source

fn index_occupied( &mut self, header: Header, hash: HashValue, index: usize, statik: Option<usize> ) -> Index

source

fn index_vacant( &mut self, header: Header, hash: HashValue, dist: usize, probe: usize, statik: Option<(usize, bool)> ) -> Index

source

fn insert(&mut self, header: Header, hash: HashValue)

source

pub fn resize(&mut self, size: usize)

source

fn update_size(&mut self, len: usize, prev_idx: Option<usize>) -> bool

source

fn converge(&mut self, prev_idx: Option<usize>) -> bool

source

fn evict(&mut self, prev_idx: Option<usize>)

source

fn remove_phase_two(&mut self, probe: usize)

source

fn reserve_one(&mut self)

source

fn grow(&mut self, new_raw_cap: usize)

source

fn reinsert_entry_in_order(&mut self, pos: Option<Pos>)

source

fn assert_valid_state(&self, _: &'static str) -> bool

Trait Implementations§

source§

impl Debug for Table

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl UnwindSafe for Table

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more