#[non_exhaustive]pub enum DisconnectReason {
UserRequested,
OutOfRange,
Timeout,
DevicePoweredOff,
BleError(String),
Unknown,
}Expand description
Reason for disconnection.
This enum is marked #[non_exhaustive] to allow adding new reasons
in future versions without breaking downstream code.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UserRequested
Normal disconnection requested by user.
OutOfRange
Device went out of range.
Timeout
Connection timed out.
DevicePoweredOff
Device was powered off.
BleError(String)
BLE error occurred.
Unknown
Unknown reason.
Trait Implementations§
Source§impl Clone for DisconnectReason
impl Clone for DisconnectReason
Source§fn clone(&self) -> DisconnectReason
fn clone(&self) -> DisconnectReason
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 DisconnectReason
impl Debug for DisconnectReason
Source§impl<'de> Deserialize<'de> for DisconnectReason
impl<'de> Deserialize<'de> for DisconnectReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DisconnectReason
impl PartialEq for DisconnectReason
Source§impl Serialize for DisconnectReason
impl Serialize for DisconnectReason
impl Eq for DisconnectReason
impl StructuralPartialEq for DisconnectReason
Auto Trait Implementations§
impl Freeze for DisconnectReason
impl RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl UnwindSafe for DisconnectReason
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