Trait StopSending

Source
pub trait StopSending {
    // Required method
    fn stop(&mut self, error_code: u64);
}

Required Methods§

Source

fn stop(&mut self, error_code: u64)

Tell peer to stop sending data with the given error code.

If all data has been received (the stream has closed), or the stream has been reset, this method will do nothing.

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

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

Implementors§