pub enum ConnectionState {
Discovered,
Connecting,
Connected,
Degraded,
Disconnecting,
Disconnected,
Lost,
}Expand description
Connection state aligned with hive-protocol abstractions
Represents the lifecycle states of a peer connection, from initial discovery through connection, degradation, and disconnection.
Variants§
Discovered
Peer has been seen via BLE advertisement but never connected
Connecting
BLE connection is being established
Connected
Active BLE connection with healthy signal
Degraded
Connected but with degraded quality (low RSSI or packet loss)
Disconnecting
Graceful disconnect in progress
Disconnected
Was previously connected, now disconnected
Lost
Disconnected and no longer seen in advertisements
Implementations§
Source§impl ConnectionState
impl ConnectionState
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if this state represents an active connection
Sourcepub fn was_connected(&self) -> bool
pub fn was_connected(&self) -> bool
Returns true if this state indicates the peer was previously known
Sourcepub fn is_degraded_or_worse(&self) -> bool
pub fn is_degraded_or_worse(&self) -> bool
Returns true if this state indicates potential connectivity issues
Trait Implementations§
Source§impl Clone for ConnectionState
impl Clone for ConnectionState
Source§fn clone(&self) -> ConnectionState
fn clone(&self) -> ConnectionState
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 ConnectionState
impl Debug for ConnectionState
Source§impl Default for ConnectionState
impl Default for ConnectionState
Source§fn default() -> ConnectionState
fn default() -> ConnectionState
Returns the “default value” for a type. Read more
Source§impl PartialEq for ConnectionState
impl PartialEq for ConnectionState
impl Copy for ConnectionState
impl Eq for ConnectionState
impl StructuralPartialEq for ConnectionState
Auto Trait Implementations§
impl Freeze for ConnectionState
impl RefUnwindSafe for ConnectionState
impl Send for ConnectionState
impl Sync for ConnectionState
impl Unpin for ConnectionState
impl UnwindSafe for ConnectionState
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