pub enum ManagerState {
Unknown,
Unsupported,
Unauthorized,
PoweredOff,
PoweredOn,
}Expand description
Mirrors CBManagerState, which is the most detailed of the platforms’
answers; the others widen into it.
This is the union of what the platforms can report, so on any one target
some variants are never constructed — Android reads its adapter state
synchronously and is never Unknown; Windows never reports Unauthorized
because WinRT fails the call instead. That is a fact about each platform
rather than dead code, and every variant is still matched in
Self::availability.
Variants§
Unknown
Not yet reported, or reported as resetting.
Unsupported
This machine has no Bluetooth LE.
This process may not use it.
PoweredOff
The radio is off.
PoweredOn
Usable.
Implementations§
Source§impl ManagerState
impl ManagerState
Sourcepub fn availability(self) -> Result<(), Availability>
pub fn availability(self) -> Result<(), Availability>
Whether Bluetooth can be used, and if not, why.
Sourcepub fn require_powered_on(self) -> Result<()>
pub fn require_powered_on(self) -> Result<()>
The same question, as the error an operation should fail with.
Trait Implementations§
Source§impl Clone for ManagerState
impl Clone for ManagerState
impl Copy for ManagerState
Source§impl Debug for ManagerState
impl Debug for ManagerState
impl Eq for ManagerState
Source§impl PartialEq for ManagerState
impl PartialEq for ManagerState
impl StructuralPartialEq for ManagerState
Auto Trait Implementations§
impl Freeze for ManagerState
impl RefUnwindSafe for ManagerState
impl Send for ManagerState
impl Sync for ManagerState
impl Unpin for ManagerState
impl UnsafeUnpin for ManagerState
impl UnwindSafe for ManagerState
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