pub enum ClientState {
ConnectTokenExpired,
InvalidConnectToken,
ConnectionTimedOut,
ConnectionResponseTimedOut,
ConnectionRequestTimedOut,
ConnectionDenied,
Disconnected,
SendingConnectionRequest,
SendingConnectionResponse,
Connected,
}Expand description
The state of a Client.
The initial state is Disconnected; the goal state is
Connected. The is_error,
is_connecting and
is_disconnected predicates classify the rest.
Variants§
ConnectTokenExpired
The connect token expired before the client finished connecting.
InvalidConnectToken
The connect token passed to Client::connect was invalid.
ConnectionTimedOut
The established connection timed out.
ConnectionResponseTimedOut
The server stopped responding while the client was sending connection responses.
ConnectionRequestTimedOut
The server never responded to the client’s connection requests.
ConnectionDenied
The server denied the connection (for example, because it was full).
Disconnected
Not connected. The initial state.
SendingConnectionRequest
Sending connection request packets to the server.
SendingConnectionResponse
Sending connection response packets to the server.
Connected
Connected: payload packets can be exchanged with the server.
Implementations§
Source§impl ClientState
impl ClientState
Sourcepub fn is_connecting(self) -> bool
pub fn is_connecting(self) -> bool
Whether the client is partway through connecting: sending connection requests or connection responses.
Sourcepub fn is_disconnected(self) -> bool
pub fn is_disconnected(self) -> bool
Whether the client is disconnected, either cleanly
(Disconnected) or in an error state.
Trait Implementations§
Source§impl Clone for ClientState
impl Clone for ClientState
Source§fn clone(&self) -> ClientState
fn clone(&self) -> ClientState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more