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§
Required Methods§
sourcefn poll_data(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Option<Self::Buf>, Self::Error>>
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
.
sourcefn stop_sending(&mut self, error_code: u64)
fn stop_sending(&mut self, error_code: u64)
Send a STOP_SENDING
QUIC code.