Skip to main content

RecvStream

Trait RecvStream 

Source
pub trait RecvStream {
    type Buf: Buf;
    type Error: Into<Box<dyn Error>>;

    // Required methods
    fn poll_data(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Result<Option<Self::Buf>, Self::Error>>;
    fn stop_sending(&mut self, error_code: u64);
    fn recv_id(&self) -> StreamId;
}
Expand description

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

Required Associated Types§

Source

type Buf: Buf

The type of Buf for data received on this stream.

Source

type Error: Into<Box<dyn Error>>

The error type that can occur when receiving data.

Required Methods§

Source

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

Poll the stream for more data.

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

Source

fn stop_sending(&mut self, error_code: u64)

Send a STOP_SENDING QUIC code.

Source

fn recv_id(&self) -> StreamId

Get QUIC send stream id

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl RecvStream for sec_http3::sec_http3_quinn::RecvStream

Source§

impl<B: Buf> RecvStream for sec_http3::sec_http3_quinn::BidiStream<B>

Source§

impl<S, B> RecvStream for sec_http3::webtransport::stream::RecvStream<S, B>
where S: RecvStream, B: Buf,

Source§

impl<S: RecvStream, B> RecvStream for sec_http3::webtransport::stream::BidiStream<S, B>