pub trait BluetoothUuidExt: Sealed {
// Required methods
fn from_u16(uuid: u16) -> Self;
fn from_u32(uuid: u32) -> Self;
fn from_bluetooth_bytes(bytes: &[u8]) -> Self;
fn is_u16_uuid(&self) -> bool;
fn is_u32_uuid(&self) -> bool;
fn try_to_u16(&self) -> Option<u16>;
fn try_to_u32(&self) -> Option<u32>;
fn as_bluetooth_bytes(&self) -> &[u8] ⓘ;
}Expand description
Extension trait for Uuid with helper methods for dealing with Bluetooth 16-bit and 32-bit UUIDs
Required Methods§
Sourcefn from_bluetooth_bytes(bytes: &[u8]) -> Self
fn from_bluetooth_bytes(bytes: &[u8]) -> Self
Sourcefn is_u16_uuid(&self) -> bool
fn is_u16_uuid(&self) -> bool
Returns true if self is a valid 16-bit Bluetooth UUID
Sourcefn is_u32_uuid(&self) -> bool
fn is_u32_uuid(&self) -> bool
Returns true if self is a valid 32-bit Bluetooth UUID
Sourcefn try_to_u16(&self) -> Option<u16>
fn try_to_u16(&self) -> Option<u16>
Tries to convert self into a 16-bit Bluetooth UUID
Sourcefn try_to_u32(&self) -> Option<u32>
fn try_to_u32(&self) -> Option<u32>
Tries to convert self into a 32-bit Bluetooth UUID
Sourcefn as_bluetooth_bytes(&self) -> &[u8] ⓘ
fn as_bluetooth_bytes(&self) -> &[u8] ⓘ
Returns a slice of octets representing the UUID. If the UUID is a valid 16- or 32-bit Bluetooth UUID, the returned slice will be 2 or 4 octets long, respectively. Otherwise the slice will be 16-octets in length.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.