pub enum ConnectionStatus {
Disconnected,
Connecting,
Connected,
Disconnecting,
}Expand description
The lifecycle state of the client’s connection to the server.
Retrieved via Client::connection_status.
Variants§
Disconnected
No socket is open; connect has not been called.
Connecting
The socket is open and the handshake is in progress.
Connected
The handshake is complete and the connection is active.
Disconnecting
disconnect has been called; awaiting confirmation.
Implementations§
Source§impl ConnectionStatus
impl ConnectionStatus
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Returns true if the client is fully disconnected.
Sourcepub fn is_connecting(&self) -> bool
pub fn is_connecting(&self) -> bool
Returns true if the handshake is in progress.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if the connection is active.
Sourcepub fn is_disconnecting(&self) -> bool
pub fn is_disconnecting(&self) -> bool
Returns true if the client is tearing down an active connection.
Trait Implementations§
Source§impl Clone for ConnectionStatus
impl Clone for ConnectionStatus
Source§fn clone(&self) -> ConnectionStatus
fn clone(&self) -> ConnectionStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for ConnectionStatus
impl PartialEq for ConnectionStatus
Source§fn eq(&self, other: &ConnectionStatus) -> bool
fn eq(&self, other: &ConnectionStatus) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ConnectionStatus
impl Eq for ConnectionStatus
impl StructuralPartialEq for ConnectionStatus
Auto Trait Implementations§
impl Freeze for ConnectionStatus
impl RefUnwindSafe for ConnectionStatus
impl Send for ConnectionStatus
impl Sync for ConnectionStatus
impl Unpin for ConnectionStatus
impl UnsafeUnpin for ConnectionStatus
impl UnwindSafe for ConnectionStatus
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