pub struct DeviceId(/* private fields */);Available on crate feature
device-id only.Expand description
An application-specific device id: 122 bits of a keyed hash, shown as an RFC 9562 version 8 UUID. Already a keyed hash, so it is safe to show.
Implementations§
Source§impl DeviceId
impl DeviceId
Sourcepub fn parse(text: &str) -> Result<DeviceId>
pub fn parse(text: &str) -> Result<DeviceId>
Parses this type’s own Display format only.
use sys_lib::device::DeviceId;
let text = "6f1c2a4e-9b3d-8e21-a7c4-0123456789ab";
assert_eq!(DeviceId::parse(text)?.to_string(), text);
assert!(DeviceId::parse("6F1C2A4E-9B3D-8E21-A7C4-0123456789AB").is_err());§Errors
InvalidInput for anything else: a wrong length, capitals, a misplaced
dash, or a version or variant that is not this type’s.
Trait Implementations§
impl Copy for DeviceId
impl Eq for DeviceId
impl StructuralPartialEq for DeviceId
Auto Trait Implementations§
impl Forget for DeviceId
impl Freeze for DeviceId
impl RefUnwindSafe for DeviceId
impl Send for DeviceId
impl Sync for DeviceId
impl Unpin for DeviceId
impl UnsafeUnpin 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