pub struct BleAddr {
pub adapter: String,
pub device: [u8; 6],
}Expand description
A parsed BLE device address.
Fields§
§adapter: StringHCI adapter name (e.g., “hci0”).
device: [u8; 6]6-byte Bluetooth device address.
Implementations§
Source§impl BleAddr
impl BleAddr
Sourcepub fn parse(s: &str) -> Result<Self, TransportError>
pub fn parse(s: &str) -> Result<Self, TransportError>
Parse a BLE address from the "adapter/AA:BB:CC:DD:EE:FF" format.
Sourcepub fn to_string_repr(&self) -> String
pub fn to_string_repr(&self) -> String
Format as "adapter/AA:BB:CC:DD:EE:FF".
Sourcepub fn to_transport_addr(&self) -> TransportAddr
pub fn to_transport_addr(&self) -> TransportAddr
Convert to a TransportAddr (string representation).
Source§impl BleAddr
impl BleAddr
Sourcepub fn from_bluer(addr: Address, adapter: &str) -> Self
pub fn from_bluer(addr: Address, adapter: &str) -> Self
Construct from a bluer Address and adapter name.
Sourcepub fn to_bluer_address(&self) -> Address
pub fn to_bluer_address(&self) -> Address
Convert to a bluer Address.
Sourcepub fn to_socket_addr(&self, psm: u16) -> SocketAddr
pub fn to_socket_addr(&self, psm: u16) -> SocketAddr
Convert to a bluer L2CAP SocketAddr with the given PSM.
Trait Implementations§
Source§impl Ord for BleAddr
impl Ord for BleAddr
1.21.0 (const: unstable) · 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 PartialOrd for BleAddr
impl PartialOrd for BleAddr
impl Eq for BleAddr
impl StructuralPartialEq for BleAddr
Auto Trait Implementations§
impl Freeze for BleAddr
impl RefUnwindSafe for BleAddr
impl Send for BleAddr
impl Sync for BleAddr
impl Unpin for BleAddr
impl UnsafeUnpin for BleAddr
impl UnwindSafe for BleAddr
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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