Skip to main content

SendStream

Trait SendStream 

Source
pub trait SendStream<B: Buf> {
    // Required methods
    fn poll_ready(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Result<(), StreamErrorIncoming>>;
    fn send_data<T: Into<WriteBuf<B>>>(
        &mut self,
        data: T,
    ) -> Result<(), StreamErrorIncoming>;
    fn poll_finish(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Result<(), StreamErrorIncoming>>;
    fn poll_stopped(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Result<Option<u64>, StreamErrorIncoming>>;
    fn reset(&mut self, reset_code: u64);
    fn send_id(&self) -> StreamId;
}
Expand description

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

Required Methods§

Source

fn poll_ready( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), StreamErrorIncoming>>

Polls if the stream can send more data.

Source

fn send_data<T: Into<WriteBuf<B>>>( &mut self, data: T, ) -> Result<(), StreamErrorIncoming>

Send more data on the stream.

Source

fn poll_finish( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), StreamErrorIncoming>>

Poll to finish the sending side of the stream.

Source

fn poll_stopped( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Option<u64>, StreamErrorIncoming>>

Polls the peer’s response to the send direction.

Resolves to Ok(Some(code)) once the peer sends STOP_SENDING, and to Ok(None) once the peer has acknowledged all data and the FIN. Fails when the connection is lost. It may be polled before or after poll_finish, never changes the stream state, and must arrange a wakeup when returning Poll::Pending. See RFC 9000, Section 3.1.

Source

fn reset(&mut self, reset_code: u64)

Send a QUIC reset code.

Source

fn send_id(&self) -> StreamId

Get QUIC send stream id

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§