Trait WriteAbort

Source
pub trait WriteAbort: Send {
    type ErrorCode: From<u32> + Send + Sync;
    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 write stream.

Sends a signal to the peer that the write side of the stream has been aborted. Discards the send buffer; if possible, no currently outstanding data is transmitted or retransmitted.

An unsigned 8-bit error code can be supplied as a part of the signal to the peer; if omitted, the error code is presumed to be 0.

Required Associated Types§

Source

type ErrorCode: From<u32> + Send + Sync

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§