Trait CancelStream

Source
pub trait CancelStream {
    // Required method
    fn cancel(&mut self, err_code: u64);
}

Required Methods§

Source

fn cancel(&mut self, err_code: u64)

Cancels the stream with the given error code.

If all data has been sent and acknowledged by the peer, or the stream has been reset, this method will do nothing.

Otherwise, a RESET_STREAM frame will be sent to the peer, and the stream will be reset, neither new data nor lost data will be sent.

Unlike TCP, canceling a QUIC stream needs an error code, which is used to indicate the reason for the cancellation. The error code should be a u64 value, defined by the application protocol using QUIC, such as HTTP/3 or gRPC.

Implementors§