pub enum ConnectionCloseReason {
Show 14 variants
Superseded,
ReaderExit,
PeerShutdown,
Banned,
LifecycleCleanup,
ApplicationClosed,
ConnectionClosed,
TimedOut,
Reset,
TransportError,
LocallyClosed,
VersionMismatch,
CidsExhausted,
Unknown,
}Expand description
ant-quic lifecycle-aware connection close reasons.
Variants§
Superseded
A newer connection superseded this one.
ReaderExit
The reader task exited and the endpoint actively closed the connection.
PeerShutdown
The remote endpoint is shutting down.
Banned
Trust or policy enforcement rejected the peer.
LifecycleCleanup
Generic lifecycle cleanup.
ApplicationClosed
The peer sent a non-lifecycle application close.
ConnectionClosed
The peer or transport closed the connection without an application code.
TimedOut
The connection timed out.
Reset
The peer reset the connection.
TransportError
A transport error closed the connection.
LocallyClosed
The local side closed the connection.
VersionMismatch
Version or capability mismatch closed the connection.
CidsExhausted
CID exhaustion closed the connection.
Unknown
Unknown or unmapped close reason.
Implementations§
Source§impl ConnectionCloseReason
impl ConnectionCloseReason
Sourcepub fn app_error_code(self) -> Option<VarInt>
pub fn app_error_code(self) -> Option<VarInt>
Return the reserved QUIC application error code, if this reason has one.
Sourcepub fn reason_bytes(self) -> &'static [u8] ⓘ
pub fn reason_bytes(self) -> &'static [u8] ⓘ
Static reason bytes used in CONNECTION_CLOSE frames.
Sourcepub fn from_app_error_code(code: VarInt) -> Option<Self>
pub fn from_app_error_code(code: VarInt) -> Option<Self>
Map a QUIC application close code into a lifecycle reason.
Sourcepub fn from_connection_error(error: &ConnectionError) -> Self
pub fn from_connection_error(error: &ConnectionError) -> Self
Map a transport connection error into a lifecycle reason.
Trait Implementations§
Source§impl Clone for ConnectionCloseReason
impl Clone for ConnectionCloseReason
Source§fn clone(&self) -> ConnectionCloseReason
fn clone(&self) -> ConnectionCloseReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionCloseReason
impl Debug for ConnectionCloseReason
Source§impl Display for ConnectionCloseReason
impl Display for ConnectionCloseReason
Source§impl Hash for ConnectionCloseReason
impl Hash for ConnectionCloseReason
Source§impl PartialEq for ConnectionCloseReason
impl PartialEq for ConnectionCloseReason
impl Copy for ConnectionCloseReason
impl Eq for ConnectionCloseReason
impl StructuralPartialEq for ConnectionCloseReason
Auto Trait Implementations§
impl Freeze for ConnectionCloseReason
impl RefUnwindSafe for ConnectionCloseReason
impl Send for ConnectionCloseReason
impl Sync for ConnectionCloseReason
impl Unpin for ConnectionCloseReason
impl UnsafeUnpin for ConnectionCloseReason
impl UnwindSafe for ConnectionCloseReason
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.