Struct Encoder
pub struct Encoder { /* private fields */ }http-backend and http and std only.Expand description
Stateful encoder for one connection. Dynamic insertion and references fall back to literals when budgets are exhausted; invalid/oversized input fails before any state changes.
Implementations§
§impl Encoder
impl Encoder
pub fn new(config: EncoderConfig) -> Encoder
pub fn new(config: EncoderConfig) -> Encoder
Create an encoder with the peer settings and local budgets.
pub fn known_received_count(&self) -> u64
pub fn known_received_count(&self) -> u64
Number of insertions acknowledged by the peer.
pub fn insert_count(&self) -> u64
pub fn insert_count(&self) -> u64
Number of dynamic entries inserted over the connection lifetime.
pub fn tracked_section_count(&self) -> usize
pub fn tracked_section_count(&self) -> usize
Number of sections awaiting acknowledgment.
pub fn tracked_reference_count(&self) -> usize
pub fn tracked_reference_count(&self) -> usize
Number of outstanding references retained for acknowledgment/cancellation.
pub fn encoder_stream_len(&self) -> usize
pub fn encoder_stream_len(&self) -> usize
Number of queued encoder-stream bytes.
pub fn take_encoder_stream(&mut self) -> Bytes
pub fn take_encoder_stream(&mut self) -> Bytes
Take queued encoder-stream bytes in order.
pub fn encode<I, F, N, V>(
&mut self,
stream_id: u64,
fields: I,
) -> Result<Bytes, QpackError>
pub fn encode<I, F, N, V>( &mut self, stream_id: u64, fields: I, ) -> Result<Bytes, QpackError>
Encode ordered fields for a HEADERS/PUSH_PROMISE payload. Tuples represent ordinary fields;
EncodeField or decoded FieldPair values preserve sensitivity.
Input size and stream ID are validated before any connection state changes. A tracking or encoder-output budget prevents optional dynamic compression rather than failing the section.
pub fn on_decoder_instruction(
&mut self,
inst: DecoderInstruction,
) -> Result<(), QpackError>
pub fn on_decoder_instruction( &mut self, inst: DecoderInstruction, ) -> Result<(), QpackError>
Apply one decoded feedback instruction (RFC 9204 §4.4).
pub fn feed_decoder_stream(&mut self, input: &[u8]) -> Result<(), QpackError>
pub fn feed_decoder_stream(&mut self, input: &[u8]) -> Result<(), QpackError>
Process arbitrarily fragmented decoder-stream bytes, retaining at most eleven bytes of one incomplete instruction. Complete instructions before a malformed one remain applied.
pub fn is_at_decoder_instruction_boundary(&self) -> bool
pub fn is_at_decoder_instruction_boundary(&self) -> bool
Whether feedback ends on an instruction boundary. The connection driver handles critical stream closure; this reports a partial instruction for diagnostics and incremental tests.
Auto Trait Implementations§
impl Freeze 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§
§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
§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