pub struct DeviceRemovalStream { /* private fields */ }Available on crate feature
async only.Expand description
Async stream of () events from IOHIDDeviceRegisterRemovalCallback.
Fires once when the device is removed. Drop the stream to clean up.
Implementations§
Source§impl DeviceRemovalStream
impl DeviceRemovalStream
Sourcepub fn subscribe(device: &HidDevice, capacity: usize) -> Self
pub fn subscribe(device: &HidDevice, capacity: usize) -> Self
Subscribe to the removal event for device.
Sourcepub const fn next(&self) -> NextItem<'_, ()>
pub const fn next(&self) -> NextItem<'_, ()>
Returns a future that resolves to Some(()) when the device is removed,
or None once the stream is closed.
Sourcepub fn buffered_count(&self) -> usize
pub fn buffered_count(&self) -> usize
Number of events currently buffered (0 or 1 for removal streams).
Trait Implementations§
impl Send for DeviceRemovalStream
impl Sync for DeviceRemovalStream
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceRemovalStream
impl !UnwindSafe for DeviceRemovalStream
impl Freeze for DeviceRemovalStream
impl Unpin for DeviceRemovalStream
impl UnsafeUnpin for DeviceRemovalStream
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