Struct h2::RecvStream [−][src]
#[must_use = "streams do nothing unless polled"]pub struct RecvStream { /* fields omitted */ }
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.0 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
impl RecvStream[src]
impl RecvStream[src]pub async fn data(&mut self) -> Option<Result<Bytes, Error>>[src]
Get the next data frame.
pub async fn trailers(&mut self) -> Result<Option<HeaderMap>, Error>[src]
Get optional trailers for this stream.
pub fn poll_data(
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Result<Bytes, Error>>>
Poll for the next data frame.
pub fn is_end_stream(&self) -> bool[src]
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.
pub fn flow_control(&mut self) -> &mut FlowControl[src]
Get a mutable reference to this stream’s FlowControl.
It can be used immediately, or cloned to be used later.
pub fn stream_id(&self) -> StreamId[src]
Trait Implementations
impl Drop for RecvStream[src]
impl Drop for RecvStream[src]Auto Trait Implementations
impl RefUnwindSafe for RecvStream
impl RefUnwindSafe for RecvStreamimpl Send for RecvStream
impl Send for RecvStreamimpl Sync for RecvStream
impl Sync for RecvStreamimpl Unpin for RecvStream
impl Unpin for RecvStreamimpl UnwindSafe for RecvStream
impl UnwindSafe for RecvStreamBlanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]