Struct FrameDecoder
pub struct FrameDecoder { /* private fields */ }http-backend and http and std only.Expand description
A bounded, incremental HTTP/3 frame decoder.
Implementations§
§impl FrameDecoder
impl FrameDecoder
pub fn new(max_frame_size: usize) -> FrameDecoder
pub fn new(max_frame_size: usize) -> FrameDecoder
Create a decoder that buffers at most max_frame_size bytes for any single non-DATA frame.
pub fn with_input_limit(
max_frame_size: usize,
max_input_size: usize,
) -> FrameDecoder
pub fn with_input_limit( max_frame_size: usize, max_input_size: usize, ) -> FrameDecoder
Set independent limits for a buffered frame and a single input chunk.
At most one input chunk is retained. Poll until more input is needed before feeding again. A zero input limit accepts only empty chunks.
pub fn feed(&mut self, input: &[u8]) -> Result<(), FrameError>
pub fn feed(&mut self, input: &[u8]) -> Result<(), FrameError>
Copy a received chunk, rejecting it before allocation if the inbox is occupied or the
chunk exceeds the input limit. Poll until Ok(None) and retry; split oversized chunks.
Prefer Self::feed_bytes to avoid this copy.
pub fn feed_bytes(&mut self, input: &mut Bytes) -> Result<(), FrameError>
pub fn feed_bytes(&mut self, input: &mut Bytes) -> Result<(), FrameError>
Transfer an owned received chunk without copying. On success input becomes empty;
on backpressure it is unchanged, so the caller can drain the decoder and retry or split it.
pub fn is_at_frame_boundary(&self) -> bool
pub fn is_at_frame_boundary(&self) -> bool
Whether the decoder is between frames with nothing buffered — i.e. a clean place for the
stream to end. If this is false at end of stream, the stream was truncated mid-frame.
pub fn poll(&mut self) -> Result<Option<FrameEvent>, FrameError>
pub fn poll(&mut self) -> Result<Option<FrameEvent>, FrameError>
Try to produce the next event. Returns Ok(None) when more input is required.
Auto Trait Implementations§
impl !Freeze for FrameDecoder
impl RefUnwindSafe for FrameDecoder
impl Send for FrameDecoder
impl Sync for FrameDecoder
impl Unpin for FrameDecoder
impl UnsafeUnpin for FrameDecoder
impl UnwindSafe for FrameDecoder
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