Struct RecvStream

struct RecvStream { ... }

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

impl RecvStream

async fn data(self: &mut Self) -> Option<Result<Bytes, Error>>

Get the next data frame.

async fn trailers(self: &mut Self) -> Result<Option<HeaderMap>, Error>

Get optional trailers for this stream.

fn poll_data(self: &mut Self, cx: &mut Context<'_>) -> Poll<Option<Result<Bytes, Error>>>

Poll for the next data frame.

fn is_end_stream(self: &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.

fn flow_control(self: &mut Self) -> &mut FlowControl

Get a mutable reference to this stream's FlowControl.

It can be used immediately, or cloned to be used later.

fn stream_id(self: &Self) -> StreamId

Returns the stream ID of this stream.

Panics

If the lock on the stream store has been poisoned.

impl Debug for RecvStream

fn fmt(self: &Self, fmt: &mut Formatter<'_>) -> Result

impl Drop for RecvStream

fn drop(self: &mut Self)

impl Freeze for RecvStream

impl RefUnwindSafe for RecvStream

impl Send for RecvStream

impl Sync for RecvStream

impl Unpin for RecvStream

impl UnsafeUnpin for RecvStream

impl UnwindSafe for RecvStream

impl<T> Any for RecvStream

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for RecvStream

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for RecvStream

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for RecvStream

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for RecvStream

impl<T> WithSubscriber for RecvStream

impl<T, U> Into for RecvStream

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for RecvStream

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for RecvStream

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>