Struct h2::RecvStream
source · [−]pub struct RecvStream { /* private fields */ }
Expand description
Receives the body stream and trailers from the remote peer.
A RecvStream
is provided by client::ResponseFuture
and
server::Connection
with the received HTTP/2 message head (the response
and request head respectively).
A RecvStream
instance is used to receive the streaming message body and
any trailers from the remote peer. It is also used to manage inbound flow
control.
See method level documentation for more details on receiving data. See
FlowControl
for more details on inbound flow control.
Implementations
sourceimpl RecvStream
impl RecvStream
sourcepub async fn trailers(&mut self) -> Result<Option<HeaderMap>, Error>
pub async fn trailers(&mut self) -> Result<Option<HeaderMap>, Error>
Get optional trailers for this stream.
sourcepub fn poll_data(
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
pub fn poll_data(
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
Poll for the next data frame.
sourcepub fn is_end_stream(&self) -> bool
pub fn is_end_stream(&self) -> bool
Returns true if the receive half has reached the end of stream.
A return value of true
means that calls to poll
and poll_trailers
will both return None
.
sourcepub fn flow_control(&mut self) -> &mut FlowControl
pub fn flow_control(&mut self) -> &mut FlowControl
Get a mutable reference to this stream’s FlowControl
.
It can be used immediately, or cloned to be used later.
Trait Implementations
sourceimpl Debug for RecvStream
impl Debug for RecvStream
Auto Trait Implementations
impl RefUnwindSafe for RecvStream
impl Send for RecvStream
impl Sync for RecvStream
impl Unpin for RecvStream
impl UnwindSafe for RecvStream
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more