pub struct Monitor { /* private fields */ }Implementations§
Source§impl Monitor
impl Monitor
pub fn new() -> Self
Sourcepub fn with_handler(
handler: impl Fn(MonitorEvent<'_>) + Send + Sync + 'static,
) -> Self
pub fn with_handler( handler: impl Fn(MonitorEvent<'_>) + Send + Sync + 'static, ) -> Self
Receives contact frames and native device-removal notifications without a stream or pump thread. Keep the handler short and nonblocking; it must not start or stop the monitor or its devices from inside the callback.
pub fn start(&self) -> bool
pub fn stop(&self)
pub fn contacts(&self) -> MonitorStream ⓘ
pub fn active_devices(&self) -> Vec<Device>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Monitor
impl !UnwindSafe for Monitor
impl Freeze for Monitor
impl Send for Monitor
impl Sync for Monitor
impl Unpin for Monitor
impl UnsafeUnpin for Monitor
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