pub enum Uuid {
Uuid16(u16),
Uuid32(u32),
Uuid128([u8; 16]),
}Expand description
A Bluetooth UUID as it appeared on the wire: 16, 32 or 128 bits.
16 and 32-bit UUIDs are shorthand for UUIDs on the Bluetooth Base UUID;
Uuid::to_u128_bytes expands them, and equality compares the expanded
forms, so Uuid16(0x180f) == Uuid128(0000180f-0000-1000-8000-00805f9b34fb).
Variants§
Uuid16(u16)
A 16-bit UUID.
Uuid32(u32)
A 32-bit UUID.
Uuid128([u8; 16])
A 128-bit UUID, most significant byte first (as written).
Implementations§
Source§impl Uuid
impl Uuid
Sourcepub fn from_le_bytes(b: &[u8]) -> Option<Uuid>
pub fn from_le_bytes(b: &[u8]) -> Option<Uuid>
Reads a UUID from its little-endian wire form, by length (2, 4 or 16 bytes).
Sourcepub fn to_le_bytes(&self) -> Vec<u8> ⓘ
pub fn to_le_bytes(&self) -> Vec<u8> ⓘ
The little-endian wire form, in its own size.
Sourcepub fn to_u128_bytes(&self) -> [u8; 16]
pub fn to_u128_bytes(&self) -> [u8; 16]
The full 128-bit form, most significant byte first.
Sourcepub fn shortened(&self) -> Uuid
pub fn shortened(&self) -> Uuid
The shortest form: a 128-bit UUID on the Base UUID becomes 16 or 32 bits.
Trait Implementations§
impl Copy for Uuid
Source§impl<'de> Deserialize<'de> for Uuid
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Uuid
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Uuid
Source§impl Ord for Uuid
impl Ord for Uuid
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Auto Trait Implementations§
impl Freeze for Uuid
impl RefUnwindSafe for Uuid
impl Send for Uuid
impl Sync for Uuid
impl Unpin for Uuid
impl UnsafeUnpin for Uuid
impl UnwindSafe for Uuid
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