pub enum HotplugEvent {
Arrived(MtpDeviceInfo),
Left(MtpDeviceInfo),
}Expand description
A device was plugged in or unplugged.
Only MTP devices produce events; see DeviceWatch for what the stream guarantees.
Deliberately not #[non_exhaustive]: a device is either here or it isn’t, and there’s no third
state to grow into. Consumers get an exhaustive match instead of a dead wildcard arm. The
payload carries MtpDeviceInfo, which is #[non_exhaustive], so new device facts still land
without breaking anyone.
Variants§
Arrived(MtpDeviceInfo)
A device appeared, or was already present when watching began.
Left(MtpDeviceInfo)
A device went away. The info is what the watch last saw for it.
Trait Implementations§
Source§impl Clone for HotplugEvent
impl Clone for HotplugEvent
Source§fn clone(&self) -> HotplugEvent
fn clone(&self) -> HotplugEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HotplugEvent
impl RefUnwindSafe for HotplugEvent
impl Send for HotplugEvent
impl Sync for HotplugEvent
impl Unpin for HotplugEvent
impl UnsafeUnpin for HotplugEvent
impl UnwindSafe for HotplugEvent
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