#[non_exhaustive]pub enum CloseReason {
Show 17 variants
KeepAlive,
ReadTimeout,
WriteTimeout,
PeerGone,
Io,
Decoder,
Encoder,
Service,
Shutdown,
Custom1,
Custom2,
Custom3,
Custom4,
Custom5,
Custom6,
Custom7,
Custom8,
}Expand description
Reason a connection was closed.
Protocol dispatchers report it with
IoRef::set_close_reason, the first
reported reason is kept. It is counted in IoMetrics when the connection
state is released.
Applications can count their own reasons with Custom1 to Custom8. Set
the reason before closing the connection or failing the service, a reason
reported by the dispatcher is not replaced.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
KeepAlive
The connection was idle for longer than the keep-alive timeout.
ReadTimeout
Input did not arrive within the read timeout.
WriteTimeout
Write backpressure stayed enabled for longer than the write timeout.
PeerGone
The peer closed the connection.
Io
The transport failed with an I/O error.
Decoder
Incoming data could not be decoded.
Encoder
Outgoing data could not be encoded.
Service
The service failed or closed the connection.
Shutdown
The server is shutting down.
Custom1
Application-defined reason, counted in CloseStats::custom[0].
Custom2
Application-defined reason, counted in CloseStats::custom[1].
Custom3
Application-defined reason, counted in CloseStats::custom[2].
Custom4
Application-defined reason, counted in CloseStats::custom[3].
Custom5
Application-defined reason, counted in CloseStats::custom[4].
Custom6
Application-defined reason, counted in CloseStats::custom[5].
Custom7
Application-defined reason, counted in CloseStats::custom[6].
Custom8
Application-defined reason, counted in CloseStats::custom[7].
Trait Implementations§
Source§impl Clone for CloseReason
impl Clone for CloseReason
Source§fn clone(&self) -> CloseReason
fn clone(&self) -> CloseReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CloseReason
Source§impl Debug for CloseReason
impl Debug for CloseReason
impl Eq for CloseReason
Source§impl Hash for CloseReason
impl Hash for CloseReason
Source§impl PartialEq for CloseReason
impl PartialEq for CloseReason
impl StructuralPartialEq for CloseReason
Auto Trait Implementations§
impl Freeze for CloseReason
impl RefUnwindSafe for CloseReason
impl Send for CloseReason
impl Sync for CloseReason
impl Unpin for CloseReason
impl UnsafeUnpin for CloseReason
impl UnwindSafe for CloseReason
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.