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§
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".