Struct DynamicTable
pub struct DynamicTable { /* private fields */ }http-backend and http and std only.Expand description
The QPACK dynamic table.
Implementations§
§impl DynamicTable
impl DynamicTable
pub fn new(max_capacity: u64) -> DynamicTable
pub fn new(max_capacity: u64) -> DynamicTable
Create a table whose capacity may grow up to max_capacity bytes. Its current capacity
starts at zero until a Set Dynamic Table Capacity instruction raises it.
pub fn max_capacity(&self) -> u64
pub fn max_capacity(&self) -> u64
The configured maximum capacity (SETTINGS_QPACK_MAX_TABLE_CAPACITY).
pub fn max_entries(&self) -> u64
pub fn max_entries(&self) -> u64
MaxEntries = floor(MaxTableCapacity / 32) (RFC 9204 §3.2.2), from the configured maximum
capacity. Used for Required Insert Count wraparound.
pub fn insert_count(&self) -> u64
pub fn insert_count(&self) -> u64
The total number of entries ever inserted; equivalently, the next absolute index.
pub fn dropped(&self) -> u64
pub fn dropped(&self) -> u64
The absolute index of the oldest entry still present (equal to insert_count when empty).
pub fn get(&self, abs: u64) -> Option<(Bytes, Bytes)>
pub fn get(&self, abs: u64) -> Option<(Bytes, Bytes)>
The name and value of the entry at absolute index abs, if present.
pub fn set_capacity(&mut self, capacity: u64) -> bool
pub fn set_capacity(&mut self, capacity: u64) -> bool
Set the current maximum capacity (RFC 9204 §3.2.3), evicting oldest entries until the size
fits. Returns false if capacity exceeds the configured maximum.
This performs unconditional eviction, so a caller that tracks references must not reduce capacity below its referenced entries.
pub fn can_insert(
&self,
need: u64,
acknowledged: Option<u64>,
) -> Result<(), InsertError>
pub fn can_insert( &self, need: u64, acknowledged: Option<u64>, ) -> Result<(), InsertError>
Check insertion before allocating or mutating the table. An encoder supplies its Known
Received Count; a decoder supplies None because encoder-stream ordering permits eviction.
pub fn insert(
&mut self,
name: Bytes,
value: Bytes,
acknowledged: Option<u64>,
) -> Result<u64, InsertError>
pub fn insert( &mut self, name: Bytes, value: Bytes, acknowledged: Option<u64>, ) -> Result<u64, InsertError>
Insert an entry, evicting as needed (RFC 9204 §3.2.2). An encoder must supply its
Known Received Count: even an unreferenced entry cannot be evicted until acknowledged.
The decoder supplies None and applies the peer’s ordered instructions unconditionally.
pub fn add_ref(&mut self, abs: u64)
pub fn add_ref(&mut self, abs: u64)
Add a reference to the entry at absolute index abs (encoder only).
pub fn release_ref(&mut self, abs: u64)
pub fn release_ref(&mut self, abs: u64)
Release a reference from the entry at absolute index abs (encoder only).
pub fn is_referenced(&self, abs: u64) -> bool
pub fn is_referenced(&self, abs: u64) -> bool
Whether the entry at absolute index abs currently has outstanding references.
Trait Implementations§
§impl Clone for DynamicTable
impl Clone for DynamicTable
§fn clone(&self) -> DynamicTable
fn clone(&self) -> DynamicTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicTable
impl RefUnwindSafe for DynamicTable
impl Send for DynamicTable
impl Sync for DynamicTable
impl Unpin for DynamicTable
impl UnsafeUnpin for DynamicTable
impl UnwindSafe for DynamicTable
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more