pub struct PluginEvent {
pub device_name: String,
pub event: u8,
}
Fields§
§device_name: String
§event: u8
Implementations§
Source§impl PluginEvent
impl PluginEvent
Sourcepub const EVENT_PLUGGED_IN: u8 = 1u8
pub const EVENT_PLUGGED_IN: u8 = 1u8
The device is plugged in
Sourcepub const EVENT_UNPLUGGED: u8 = 2u8
pub const EVENT_UNPLUGGED: u8 = 2u8
The device is unplugged
pub fn new(device_name: impl Into<String>, event: u8) -> Self
pub fn plugged_in(device_name: impl AsRef<str>) -> Self
pub fn unplugged(device_name: impl AsRef<str>) -> Self
pub fn is_plugged_in(&self) -> bool
pub fn is_unplugged(&self) -> bool
pub fn event_description(&self) -> &'static str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginEvent
impl RefUnwindSafe for PluginEvent
impl Send for PluginEvent
impl Sync for PluginEvent
impl Unpin for PluginEvent
impl UnwindSafe for PluginEvent
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