pub enum ConnectionStatus {
NeverTried,
Connecting,
Connected,
RetryPending,
Failed(ConnectionFailureKind),
}Expand description
Represents the current status of a connection attempt for a host/plugin pair.
This enum tracks the lifecycle of a connection attempt, from the initial state
through various stages of connection establishment, including success, retry,
and failure states. It is used within ConnectionAttemptState to provide
high-level information about the current state of a connection.
§Variants
-
NeverTried- No connection attempt has been made yet for this host/plugin combination. This is the initial state before any connection activity. -
Connecting- A connection attempt is currently in progress. This state is set whenState::begin_connection_attemptis called and indicates that the connection plugin is actively attempting to establish a connection. -
Connected- The connection has been successfully established. This state is set whenState::mark_connection_connectedis called and indicates that the connection is ready for use. -
RetryPending- A connection attempt has failed but will be retried. This state is set whenState::mark_connection_retry_pendingis called and indicates that the connection will be attempted again after a delay or under different conditions. -
Failed(ConnectionFailureKind)- The connection attempt has failed and will not be retried. This state is set whenState::mark_connection_failedis called and includes aConnectionFailureKindthat classifies the type of failure that occurred (e.g., timeout, authentication failure, DNS error).
§Examples
// Check different connection states
let connecting = ConnectionStatus::Connecting;
let connected = ConnectionStatus::Connected;
let failed = ConnectionStatus::Failed(ConnectionFailureKind::Timeout);
assert_eq!(connecting, ConnectionStatus::Connecting);
assert_eq!(connected, ConnectionStatus::Connected);
assert!(matches!(failed, ConnectionStatus::Failed(_)));Variants§
Trait Implementations§
Source§impl Clone for ConnectionStatus
impl Clone for ConnectionStatus
Source§fn clone(&self) -> ConnectionStatus
fn clone(&self) -> ConnectionStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectionStatus
impl Debug for ConnectionStatus
impl Eq for ConnectionStatus
Source§impl PartialEq for ConnectionStatus
impl PartialEq for ConnectionStatus
Source§fn eq(&self, other: &ConnectionStatus) -> bool
fn eq(&self, other: &ConnectionStatus) -> bool
self and other values to be equal, and is used by ==.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
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§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.