Enum socketioxide::socket::DisconnectReason
source · pub enum DisconnectReason {
TransportClose,
MultipleHttpPollingError,
PacketParsingError,
TransportError,
HeartbeatTimeout,
ClientNSDisconnect,
ServerNSDisconnect,
ClosingServer,
}
Expand description
All the possible reasons for a Socket
to be disconnected from a namespace.
It can be used as an extractor in the on_disconnect
handler.
Variants§
TransportClose
The client gracefully closed the connection
MultipleHttpPollingError
The client sent multiple polling requests at the same time (it is forbidden according to the engine.io protocol)
PacketParsingError
The client sent a bad request / the packet could not be parsed correctly
TransportError
The connection was closed (example: the user has lost connection, or the network was changed from WiFi to 4G)
HeartbeatTimeout
The client did not send a PONG packet in the ping timeout
delay
ClientNSDisconnect
The client has manually disconnected the socket using socket.disconnect()
ServerNSDisconnect
The socket was forcefully disconnected from the namespace with Socket::disconnect
ClosingServer
The server is being closed
Trait Implementations§
source§impl Clone for DisconnectReason
impl Clone for DisconnectReason
source§fn clone(&self) -> DisconnectReason
fn clone(&self) -> DisconnectReason
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DisconnectReason
impl Debug for DisconnectReason
source§impl Display for DisconnectReason
impl Display for DisconnectReason
source§impl From<DisconnectReason> for DisconnectReason
impl From<DisconnectReason> for DisconnectReason
source§fn from(reason: EIoDisconnectReason) -> Self
fn from(reason: EIoDisconnectReason) -> Self
Converts to this type from the input type.
source§impl<A: Adapter> FromDisconnectParts<A> for DisconnectReason
impl<A: Adapter> FromDisconnectParts<A> for DisconnectReason
§type Error = Infallible
type Error = Infallible
The error type returned by the extractor
source§fn from_disconnect_parts(
_: &Arc<Socket<A>>,
reason: DisconnectReason
) -> Result<Self, Infallible>
fn from_disconnect_parts( _: &Arc<Socket<A>>, reason: DisconnectReason ) -> Result<Self, Infallible>
Extract the arguments from the disconnect event.
If it fails, the handler is not called
source§impl PartialEq for DisconnectReason
impl PartialEq for DisconnectReason
source§fn eq(&self, other: &DisconnectReason) -> bool
fn eq(&self, other: &DisconnectReason) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for DisconnectReason
impl Eq for DisconnectReason
impl StructuralPartialEq for DisconnectReason
Auto Trait Implementations§
impl Freeze for DisconnectReason
impl RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl UnwindSafe for DisconnectReason
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.