pub struct DeviceHandle { /* private fields */ }Expand description
Device handle for thread-safe access. Uses tokio::sync::RwLock for async-friendly locking.
Implementations§
Source§impl DeviceHandle
impl DeviceHandle
Sourcepub fn new(device: BoxedDevice) -> Self
pub fn new(device: BoxedDevice) -> Self
Create a new device handle.
Sourcepub fn info(&self) -> DeviceInfo
pub fn info(&self) -> DeviceInfo
Get device info (synchronous, returns cached info).
Sourcepub fn state(&self) -> DeviceState
pub fn state(&self) -> DeviceState
Get device state (synchronous, returns cached state).
Sourcepub async fn refresh_info(&self)
pub async fn refresh_info(&self)
Refresh cached info from the device.
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize the device.
Trait Implementations§
Source§impl Clone for DeviceHandle
impl Clone for DeviceHandle
Source§fn clone(&self) -> DeviceHandle
fn clone(&self) -> DeviceHandle
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 moreAuto Trait Implementations§
impl Freeze for DeviceHandle
impl !RefUnwindSafe for DeviceHandle
impl Send for DeviceHandle
impl Sync for DeviceHandle
impl Unpin for DeviceHandle
impl UnsafeUnpin for DeviceHandle
impl !UnwindSafe for DeviceHandle
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