ReadAbort

Trait ReadAbort 

Source
pub trait ReadAbort: Send {
    type ErrorCode: From<u32> + Send + Sync + 'static;
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn abort(
        self,
        error_code: Self::ErrorCode,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Abort the read stream.

Sends a signal to the peer that the read side of the stream has been aborted. Discards the receive buffer; the peer is typically expected to abort the corresponding send side in response.

An unsigned 8-bit error code can be supplied as a part of the signal to the peer.

Required Associated Types§

Source

type ErrorCode: From<u32> + Send + Sync + 'static

An error code to abort the stream with.

Pass 0 for default.

Source

type Error: Error + Send + Sync + 'static

An error that can occur while stopping the stream.

Required Methods§

Source

fn abort( self, error_code: Self::ErrorCode, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Abort the stream.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§