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§
Source§impl<'de> Deserialize<'de> for NfcUid
impl<'de> Deserialize<'de> for NfcUid
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 UnsafeUnpin 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.Source§impl<T> Erasable for T
impl<T> Erasable for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more