pub struct BDAddr { /* private fields */ }
Expand description
Stores the 6 byte address used to identify Bluetooth devices.
Implementations§
Source§impl BDAddr
impl BDAddr
Sourcepub fn into_inner(self) -> [u8; 6]
pub fn into_inner(self) -> [u8; 6]
Destruct the address into the underlying array.
Sourcepub fn is_random_static(&self) -> bool
pub fn is_random_static(&self) -> bool
Check if this address is a randomly generated.
Sourcepub fn from_str_delim(s: &str) -> Result<BDAddr, ParseBDAddrError>
pub fn from_str_delim(s: &str) -> Result<BDAddr, ParseBDAddrError>
Parses a Bluetooth address with colons :
as delimiters.
All hex-digits [0-9a-fA-F]
are allowed.
Sourcepub fn from_str_no_delim(s: &str) -> Result<BDAddr, ParseBDAddrError>
pub fn from_str_no_delim(s: &str) -> Result<BDAddr, ParseBDAddrError>
Parses a Bluetooth address without delimiters.
All hex-digits [0-9a-fA-F]
are allowed.
Sourcepub fn write_no_delim(&self, f: &mut impl Write) -> Result<(), Error>
pub fn write_no_delim(&self, f: &mut impl Write) -> Result<(), Error>
Writes the address without delimiters.
Sourcepub fn to_string_no_delim(&self) -> String
pub fn to_string_no_delim(&self) -> String
Create a String
with the address with no delimiters.
For the more common presentation with colons use the to_string()
method.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BDAddr
impl<'de> Deserialize<'de> for BDAddr
Source§fn deserialize<D>(
deserializer: D,
) -> Result<BDAddr, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BDAddr, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<MacAddress> for BDAddr
impl From<MacAddress> for BDAddr
Source§fn from(mac_address: MacAddress) -> BDAddr
fn from(mac_address: MacAddress) -> BDAddr
Converts to this type from the input type.
Source§impl Ord for BDAddr
impl Ord for BDAddr
Source§impl PartialOrd for BDAddr
impl PartialOrd for BDAddr
Source§impl Serialize for BDAddr
impl Serialize for BDAddr
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for BDAddr
impl Eq for BDAddr
impl StructuralPartialEq for BDAddr
Auto Trait Implementations§
impl Freeze for BDAddr
impl RefUnwindSafe for BDAddr
impl Send for BDAddr
impl Sync for BDAddr
impl Unpin for BDAddr
impl UnwindSafe for BDAddr
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