pub struct FrameStream<S, B> {
pub stream: BufRecvStream<S, B>,
/* private fields */
}Available on crate feature
h3 only.Expand description
Decodes Frames from the underlying QUIC stream
Fields§
§stream: BufRecvStream<S, B>Implementations§
Source§impl<S, B> FrameStream<S, B>
impl<S, B> FrameStream<S, B>
pub fn new(stream: BufRecvStream<S, B>) -> FrameStream<S, B>
Sourcepub fn into_inner(self) -> BufRecvStream<S, B>
pub fn into_inner(self) -> BufRecvStream<S, B>
Unwraps the Framed streamer and returns the underlying stream without data loss for partially received/read frames.
Source§impl<S, B> FrameStream<S, B>where
S: RecvStream,
impl<S, B> FrameStream<S, B>where
S: RecvStream,
Sourcepub fn poll_next(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Option<Frame<PayloadLen>>, FrameStreamError>>
pub fn poll_next( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Option<Frame<PayloadLen>>, FrameStreamError>>
Polls the stream for the next frame header
When a frame header is received use poll_data to retrieve the frame’s data.
Sourcepub fn poll_data(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<Option<impl Buf>, FrameStreamError>>
pub fn poll_data( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Option<impl Buf>, FrameStreamError>>
Retrieves the next piece of data in an incoming data packet or webtransport stream
WebTransport bidirectional payload has no finite length and is processed until the end of the stream.
pub fn id(&self) -> StreamId
Trait Implementations§
Source§impl<T, B> SendStream<B> for FrameStream<T, B>where
T: SendStream<B>,
B: Buf,
impl<T, B> SendStream<B> for FrameStream<T, B>where
T: SendStream<B>,
B: Buf,
Source§fn poll_ready(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), StreamErrorIncoming>>
fn poll_ready( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), StreamErrorIncoming>>
Polls if the stream can send more data.
Source§fn send_data<D>(&mut self, data: D) -> Result<(), StreamErrorIncoming>
fn send_data<D>(&mut self, data: D) -> Result<(), StreamErrorIncoming>
Send more data on the stream.
Source§fn poll_finish(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), StreamErrorIncoming>>
fn poll_finish( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), StreamErrorIncoming>>
Poll to finish the sending side of the stream.
Auto Trait Implementations§
impl<S, B> Freeze for FrameStream<S, B>where
S: Freeze,
impl<S, B> RefUnwindSafe for FrameStream<S, B>where
S: RefUnwindSafe,
B: RefUnwindSafe,
impl<S, B> Send for FrameStream<S, B>
impl<S, B> Sync for FrameStream<S, B>
impl<S, B> Unpin for FrameStream<S, B>
impl<S, B> UnwindSafe for FrameStream<S, B>where
S: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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