#[non_exhaustive]pub enum CloseReason {
Local,
PeerRequested(SessionRequestType),
LocallyRequested(SessionRequestType),
TransportClosed,
UnsupportedVersion {
selected: ProtocolVersion,
},
NoCommonVersion,
PermanentError(String),
ProtocolError(String),
}Expand description
Why a session ended.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Local
The application asked for it.
PeerRequested(SessionRequestType)
The peer sent a SessionRequest.
LocallyRequested(SessionRequestType)
This side sent a SessionRequest.
Distinct from PeerRequested because the two are not the
same event to anybody reading a log: one is a device being told to go away, the
other is a device deciding to. Both still carry the request type, because
RECONNECT and TERMINATE differ in urgency whichever side asked
(S2J schemas/SessionRequestType).
TransportClosed
The transport went away.
UnsupportedVersion
The peer selected a version that was never offered.
Fields
selected: ProtocolVersionWhat it chose.
NoCommonVersion
The two sides have no version in common.
PermanentError(String)
The peer reported an error it cannot recover from.
S2J schemas/ReceptionStatusValues: PERMANENT_ERROR — “Consequence: Disconnect.”
ProtocolError(String)
The peer did something the protocol does not allow, and the session was configured to close on it.
Trait Implementations§
Source§impl Clone for CloseReason
impl Clone for CloseReason
Source§impl Debug for CloseReason
impl Debug for CloseReason
Source§impl Display for CloseReason
impl Display for CloseReason
impl Eq for CloseReason
Source§impl Error for CloseReason
impl Error for CloseReason
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for CloseReason
impl PartialEq for CloseReason
impl StructuralPartialEq for CloseReason
Auto Trait Implementations§
impl Forget for CloseReason
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§
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,
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.