pub enum ClientState {
Connected(Address),
Connecting(Address),
Disconnected,
Disconnecting,
}
Expand description
Client states
State Diagram
+--------+-----------------------------------------+
| | |
| v v
+----------------+ +---+--------+---+ +----------------+ +--------+-------+
| | | | | | | |
| Disconnected +---->+ Connecting +---->+ Connected +---->+ Disconnecting |
| | | | | | | |
+-------+--------+ +----------------+ +--------+-------+ +--------+-------+
^ | |
| | |
+----------------------------------------------+----------------------+
Variants§
Connected(Address)
The client is connected to an address.
Connecting(Address)
The client is connecting to an address.
Disconnected
The client is disconnected.
Disconnecting
The client has been instructed to disconnect by calling
disconnect
.
Implementations§
Source§impl ClientState
impl ClientState
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Is the state Connected
?
Sourcepub fn is_connecting(&self) -> bool
pub fn is_connecting(&self) -> bool
Is the state Connecting
?
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Is the state Disconnected
?
Sourcepub fn is_disconnecting(&self) -> bool
pub fn is_disconnecting(&self) -> bool
Is the state Disconnecting
?
Trait Implementations§
Source§impl Clone for ClientState
impl Clone for ClientState
Source§fn clone(&self) -> ClientState
fn clone(&self) -> ClientState
Returns a duplicate 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 ClientState
impl Debug for ClientState
Auto Trait Implementations§
impl Freeze for ClientState
impl RefUnwindSafe for ClientState
impl Send for ClientState
impl Sync for ClientState
impl Unpin for ClientState
impl UnwindSafe for ClientState
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