pub enum NfcUid {
Single([u8; 4]),
Double([u8; 7]),
Triple([u8; 10]),
}Expand description
Represents an NFC UID of standard lengths.
NFC UIDs come in three typical sizes:
Single: 4 bytesDouble: 7 bytesTriple: 10 bytes
This enum encapsulates these variants and ensures correct sizing during
construction via TryFrom<&[u8]> or hex parsing (FromHex).
Use [as_bytes()] to get a byte slice of the underlying UID.
§Examples
use bloop_server_framework::nfc_uid::NfcUid;
let uid = NfcUid::try_from(&[0x01, 0x02, 0x03, 0x04][..]).unwrap();
assert_eq!(uid.as_bytes(), &[0x01, 0x02, 0x03, 0x04]);Variants§
Implementations§
Trait Implementations§
impl Copy for NfcUid
impl Eq for NfcUid
impl StructuralPartialEq for NfcUid
Auto Trait Implementations§
impl Freeze for NfcUid
impl RefUnwindSafe for NfcUid
impl Send for NfcUid
impl Sync for NfcUid
impl Unpin for NfcUid
impl UnwindSafe for NfcUid
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.