pub enum ConnectionStatus {
Connected,
Disconnected {
close_code: Option<u16>,
reconnect_attempts: u8,
},
FatallyClosed {
close_code: CloseCode,
},
Identifying,
Resuming,
}
Expand description
Current status of a shard.
Variants§
Connected
Shard is connected to the gateway with an active session.
Disconnected
Fields
Shard is disconnected from the gateway but may reconnect in the future.
The underlying connection may still be open.
FatallyClosed
Shard has fatally closed.
Possible reasons may be due to failed authentication,
invalid intents, or other reasons. Refer to the documentation for
CloseCode
for possible reasons.
Identifying
Shard is waiting to establish or resume a session.
Resuming
Shard is replaying missed dispatch events.
The shard is considered identified whilst resuming.
Implementations§
source§impl ConnectionStatus
impl ConnectionStatus
sourcepub const fn is_connected(&self) -> bool
pub const fn is_connected(&self) -> bool
Whether the shard is connected with an active session.
sourcepub const fn is_disconnected(&self) -> bool
pub const fn is_disconnected(&self) -> bool
Whether the shard has disconnected but may reconnect in the future.
sourcepub const fn is_fatally_closed(&self) -> bool
pub const fn is_fatally_closed(&self) -> bool
Whether the shard has fatally closed, such as due to an invalid token.
sourcepub const fn is_identified(&self) -> bool
pub const fn is_identified(&self) -> bool
sourcepub const fn is_identifying(&self) -> bool
pub const fn is_identifying(&self) -> bool
Whether the shard is waiting to establish an active session.
sourcepub const fn is_resuming(&self) -> bool
pub const fn is_resuming(&self) -> bool
Whether the shard is replaying missed dispatch events.
The shard is considered identified whilst resuming.
Trait Implementations§
source§impl Clone for ConnectionStatus
impl Clone for ConnectionStatus
source§fn clone(&self) -> ConnectionStatus
fn clone(&self) -> ConnectionStatus
1.0.0 · 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
source§impl PartialEq<ConnectionStatus> for ConnectionStatus
impl PartialEq<ConnectionStatus> 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 Eq for ConnectionStatus
impl StructuralEq for ConnectionStatus
impl StructuralPartialEq for ConnectionStatus
Auto Trait Implementations§
impl RefUnwindSafe for ConnectionStatus
impl Send for ConnectionStatus
impl Sync for ConnectionStatus
impl Unpin 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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.