#[non_exhaustive]pub enum DeviceId {
DevPath(PathBuf),
}
Expand description
A platform-specific identifier for a device.
Can be used as opaque type for equality checks or inspected with platform specific code:
let id: DeviceId = /* ... */
match(id) {
#[cfg(target_os = "windows")]
DeviceId::UncPath(path) => { /* .. */ },
#[cfg(target_os = "linux")]
DeviceId::DevPath(path) => { /* .. */ },
#[cfg(target_os = "macos")]
DeviceId::RegistryEntryId(id) => { /* .. */ }
_ => {}
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Trait Implementations§
impl Eq for DeviceId
impl StructuralPartialEq for DeviceId
Auto Trait Implementations§
impl Freeze for DeviceId
impl RefUnwindSafe for DeviceId
impl Send for DeviceId
impl Sync for DeviceId
impl Unpin for DeviceId
impl UnwindSafe for DeviceId
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