pub enum Address {
Public(AddressBytes),
Random(AddressBytes),
}
Expand description
A Bluetooth device address can either be public or private. The controller device address used in BR/EDR (aka BD_ADDR) and LE have the “public” address type. A private address is one that is randomly generated by the controller or the host and can only be used in LE. The identity address can be random (often “static random”) but is not typically considered private.
Some controller procedures depend on knowledge of whether an address is public (i.e. the BD_ADDR assigned to the controller) or randomly assigned by the host. This enum type represents that information.
This type represents a Bluetooth device address. Address
can be converted to/from a FIDL
Bluetooth device address type.
Variants§
Public(AddressBytes)
Random(AddressBytes)
Implementations§
Source§impl Address
impl Address
pub fn public_from_str(s: &str) -> Result<Address, Error>
pub fn random_from_str(s: &str) -> Result<Address, Error>
pub fn address_type_string(&self) -> String
pub fn as_hex_string(&self) -> String
pub fn bytes(&self) -> &AddressBytes
Trait Implementations§
Source§impl PartialEq<str> for Address
impl PartialEq<str> for Address
Address is comparable with a string-based representation of the address, i.e. Address::Public([6, 5, 4, 3, 2, 1]) == “01:02:03:04:05:06”
Source§impl WriteInspect for Address
impl WriteInspect for Address
Source§fn write_inspect(&self, writer: &Node, key: impl Into<StringReference>)
fn write_inspect(&self, writer: &Node, key: impl Into<StringReference>)
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)