pub struct BluetoothUuid16(/* private fields */);
Expand description
A 16-bit Bluetooth UUID
Implementations§
Source§impl BluetoothUuid16
impl BluetoothUuid16
Sourcepub const fn new(uuid: u16) -> BluetoothUuid16
pub const fn new(uuid: u16) -> BluetoothUuid16
Creates a new UUID.
Sourcepub const fn from_le_bytes(bytes: [u8; 2]) -> BluetoothUuid16
pub const fn from_le_bytes(bytes: [u8; 2]) -> BluetoothUuid16
Creates a UUID from a little-endian byte array.
Sourcepub fn from_be_bytes(bytes: [u8; 2]) -> BluetoothUuid16
pub fn from_be_bytes(bytes: [u8; 2]) -> BluetoothUuid16
Creates a UUID from a big-endian byte array.
Sourcepub fn from_le_slice(
bytes: &[u8],
) -> Result<BluetoothUuid16, InvalidLengthError>
pub fn from_le_slice( bytes: &[u8], ) -> Result<BluetoothUuid16, InvalidLengthError>
Attempts to create a UUID from a little-endian byte slice.
Sourcepub fn from_be_slice(
bytes: &[u8],
) -> Result<BluetoothUuid16, InvalidLengthError>
pub fn from_be_slice( bytes: &[u8], ) -> Result<BluetoothUuid16, InvalidLengthError>
Attempts to create a UUID from a big-endian byte slice.
Sourcepub const fn as_le_bytes(&self) -> &[u8; 2]
pub const fn as_le_bytes(&self) -> &[u8; 2]
Returns the UUID as a little-endian byte array.
Sourcepub const fn to_le_bytes(self) -> [u8; 2]
pub const fn to_le_bytes(self) -> [u8; 2]
Consumes the UUID and returns its little-endian byte array representation.
Sourcepub fn to_be_bytes(self) -> [u8; 2]
pub fn to_be_bytes(self) -> [u8; 2]
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.
Trait Implementations§
Source§impl AsRef<[u8]> for BluetoothUuid16
impl AsRef<[u8]> for BluetoothUuid16
Source§impl Clone for BluetoothUuid16
impl Clone for BluetoothUuid16
Source§fn clone(&self) -> BluetoothUuid16
fn clone(&self) -> BluetoothUuid16
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BluetoothUuid16
impl Debug for BluetoothUuid16
Source§impl Display for BluetoothUuid16
impl Display for BluetoothUuid16
Source§impl Format for BluetoothUuid16
impl Format for BluetoothUuid16
Source§impl From<BluetoothUuid16> for BluetoothUuid
impl From<BluetoothUuid16> for BluetoothUuid
Source§fn from(value: BluetoothUuid16) -> BluetoothUuid
fn from(value: BluetoothUuid16) -> BluetoothUuid
Converts to this type from the input type.
Source§impl From<BluetoothUuid16> for Uuid
impl From<BluetoothUuid16> for Uuid
Source§fn from(data: BluetoothUuid16) -> Self
fn from(data: BluetoothUuid16) -> Self
Converts to this type from the input type.
Source§impl From<u16> for BluetoothUuid16
impl From<u16> for BluetoothUuid16
Source§fn from(value: u16) -> BluetoothUuid16
fn from(value: u16) -> BluetoothUuid16
Converts to this type from the input type.
Source§impl Hash for BluetoothUuid16
impl Hash for BluetoothUuid16
Source§impl Ord for BluetoothUuid16
impl Ord for BluetoothUuid16
Source§fn cmp(&self, other: &BluetoothUuid16) -> Ordering
fn cmp(&self, other: &BluetoothUuid16) -> Ordering
1.21.0 · 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
Source§impl PartialEq for BluetoothUuid16
impl PartialEq for BluetoothUuid16
Source§impl PartialOrd for BluetoothUuid16
impl PartialOrd for BluetoothUuid16
impl Copy for BluetoothUuid16
impl Eq for BluetoothUuid16
impl StructuralPartialEq for BluetoothUuid16
Auto Trait Implementations§
impl Freeze for BluetoothUuid16
impl RefUnwindSafe for BluetoothUuid16
impl Send for BluetoothUuid16
impl Sync for BluetoothUuid16
impl Unpin for BluetoothUuid16
impl UnwindSafe for BluetoothUuid16
Blanket Implementations§
Source§impl<T> AsGatt for Twhere
T: FixedGattValue,
impl<T> AsGatt for Twhere
T: FixedGattValue,
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