RecvStream

Trait RecvStream 

pub trait RecvStream {
    type Buf: Buf;

    // Required methods
    fn poll_data(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Result<Option<Self::Buf>, StreamErrorIncoming>>;
    fn stop_sending(&mut self, error_code: u64);
    fn recv_id(&self) -> StreamId;
}
Available on crate features quic and h3 only.
Expand description

A trait describing the “receive” actions of a QUIC stream.

Required Associated Types§

type Buf: Buf

The type of Buf for data received on this stream.

Required Methods§

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

Poll the stream for more data.

When the receiving side will no longer receive more data (such as because the peer closed their sending side), this should return None.

fn stop_sending(&mut self, error_code: u64)

Send a STOP_SENDING QUIC code.

fn recv_id(&self) -> StreamId

Get QUIC send stream id

Implementors§

Source§

impl RecvStream for RecvStream

Source§

impl<B> RecvStream for BidiStream<B>
where B: Buf,

§

impl<S, B> RecvStream for BufRecvStream<S, B>
where S: RecvStream,

§

type Buf = Bytes