pub struct BluetoothUuid128(/* private fields */);
Expand description
A 128-bit Bluetooth UUID
Implementations§
Source§impl BluetoothUuid128
impl BluetoothUuid128
Sourcepub const fn new(uuid: u128) -> BluetoothUuid128
pub const fn new(uuid: u128) -> BluetoothUuid128
Creates a new UUID.
Sourcepub const fn from_le_bytes(bytes: [u8; 16]) -> BluetoothUuid128
pub const fn from_le_bytes(bytes: [u8; 16]) -> BluetoothUuid128
Creates a UUID from a little-endian byte array.
Sourcepub fn from_be_bytes(bytes: [u8; 16]) -> BluetoothUuid128
pub fn from_be_bytes(bytes: [u8; 16]) -> BluetoothUuid128
Creates a UUID from a big-endian byte array.
Sourcepub fn from_le_slice(
bytes: &[u8],
) -> Result<BluetoothUuid128, InvalidLengthError>
pub fn from_le_slice( bytes: &[u8], ) -> Result<BluetoothUuid128, InvalidLengthError>
Attempts to create a UUID from a little-endian byte slice.
Sourcepub fn from_be_slice(
bytes: &[u8],
) -> Result<BluetoothUuid128, InvalidLengthError>
pub fn from_be_slice( bytes: &[u8], ) -> Result<BluetoothUuid128, InvalidLengthError>
Attempts to create a UUID from a big-endian byte slice.
Sourcepub const fn as_le_bytes(&self) -> &[u8; 16]
pub const fn as_le_bytes(&self) -> &[u8; 16]
Returns the UUID as a little-endian byte array.
Sourcepub const fn to_le_bytes(self) -> [u8; 16]
pub const fn to_le_bytes(self) -> [u8; 16]
Consumes the UUID and returns its little-endian byte array representation.
Sourcepub fn to_be_bytes(self) -> [u8; 16]
pub fn to_be_bytes(self) -> [u8; 16]
Consumes the UUID and returns its big-endian byte array representation.
Sourcepub const fn as_le_slice(&self) -> &[u8]
pub const fn as_le_slice(&self) -> &[u8]
Returns the UUID as a little-endian byte slice.
Source§impl BluetoothUuid128
impl BluetoothUuid128
Sourcepub const fn base() -> BluetoothUuid128
pub const fn base() -> BluetoothUuid128
The standard Bluetooth Base UUID.
The value is 00000000-0000-1000-8000-00805F9B34FB
.
The full 128-bit value of a 16-bit or 32-bit UUID may be computed by a simple arithmetic operation.
128_bit_value = 16_bit_value * 2^96 + Bluetooth_Base_UUID
See BLUETOOTH CORE SPECIFICATION Version 6.0 | Vol 3, Part B | Page 1250 (link)
Sourcepub const fn nil() -> BluetoothUuid128
pub const fn nil() -> BluetoothUuid128
Creates a new nil (all-zero) 128-bit UUID.
Sourcepub const fn to_fields(&self) -> (u32, u16, u16, u64)
pub const fn to_fields(&self) -> (u32, u16, u16, u64)
Returns the raw components of the 128-bit UUID.
The fields are returned in big-endian order: (time_low, time_mid, time_high_and_version, clock_seq_and_node)
.
Sourcepub const fn set_initial_group(self, val: u32) -> BluetoothUuid128
pub const fn set_initial_group(self, val: u32) -> BluetoothUuid128
Sets the value of the initial 32-bits of the UUID (in big-endian format) to val
.
This can be used to construct a 128-bit UUID value from a 16- or 32-bit UUID
value using Self::base()
as the base 128-bit UUID value.
Trait Implementations§
Source§impl AsRef<[u8]> for BluetoothUuid128
impl AsRef<[u8]> for BluetoothUuid128
Source§impl Clone for BluetoothUuid128
impl Clone for BluetoothUuid128
Source§fn clone(&self) -> BluetoothUuid128
fn clone(&self) -> BluetoothUuid128
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more