Enum iroh_bytes::protocol::Closed
source · #[repr(u16)]pub enum Closed {
StreamDropped = 0,
ProviderTerminating = 1,
RequestReceived = 2,
}Expand description
Reasons to close connections or stop streams.
A QUIC connection can be closed and a stream can request the other side to
stop sending data. Both closing and stopping have an associated error_code, closing
also adds a reason as some arbitrary bytes.
This enum exists so we have a single namespace for error_codes used.
Variants§
StreamDropped = 0
The quinn::RecvStream was dropped.
Used implicitly when a quinn::RecvStream is dropped without explicit call to
quinn::RecvStream::stop. We don’t use this explicitly but this is here as
documentation as to what happened to 0.
ProviderTerminating = 1
The provider is terminating.
When a provider terminates all connections and associated streams are closed.
RequestReceived = 2
The provider has received the request.
Only a single request is allowed on a stream, if more data is received after this a provider may send this error code in a STOP_STREAM frame.