Trait salvo_core::proto::quic::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;
}
Available on crate feature quinn only.
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

Implementors§

source§

impl RecvStream for salvo_http3::http3_quinn::RecvStream

source§

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

source§

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

§

type Buf = Bytes

§

type Error = <S as RecvStream>::Error

source§

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

§

type Buf = Bytes

§

type Error = <S as RecvStream>::Error

source§

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

§

type Buf = Bytes

§

type Error = <S as RecvStream>::Error