Skip to main content

WriteAbort

Trait WriteAbort 

Source
pub trait WriteAbort: Send {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn abort(
        self,
        error_code: 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 Error: Error + Send + Sync + 'static

An error that can occur while stopping the stream.

Required Methods§

Source

fn abort( self, error_code: 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".

Implementors§