pub struct ManagedDevice {
pub id: String,
pub name: Option<String>,
pub device_type: Option<DeviceType>,
pub auto_reconnect: bool,
pub last_reading: Option<CurrentReading>,
pub info: Option<DeviceInfo>,
pub reconnect_options: ReconnectOptions,
/* private fields */
}Expand description
Information about a managed device.
Fields§
§id: StringDevice identifier.
name: Option<String>Device name.
device_type: Option<DeviceType>Device type.
auto_reconnect: boolWhether auto-reconnect is enabled.
last_reading: Option<CurrentReading>Last known reading.
info: Option<DeviceInfo>Device info.
reconnect_options: ReconnectOptionsReconnection options (if auto-reconnect is enabled).
Implementations§
Source§impl ManagedDevice
impl ManagedDevice
Sourcepub fn with_reconnect_options(id: &str, options: ReconnectOptions) -> Self
pub fn with_reconnect_options(id: &str, options: ReconnectOptions) -> Self
Create a managed device with custom reconnect options.
Sourcepub fn has_device(&self) -> bool
pub fn has_device(&self) -> bool
Check if the device is connected (sync check, doesn’t query BLE).
Sourcepub async fn is_connected(&self) -> bool
pub async fn is_connected(&self) -> bool
Check if the device is connected (async, queries BLE).
Sourcepub fn device_arc(&self) -> Option<Arc<Device>>
pub fn device_arc(&self) -> Option<Arc<Device>>
Get a clone of the device Arc.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ManagedDevice
impl !RefUnwindSafe for ManagedDevice
impl Send for ManagedDevice
impl Sync for ManagedDevice
impl Unpin for ManagedDevice
impl !UnwindSafe for ManagedDevice
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