#[repr(u32)]pub enum LeSecurityMode {
Mode1 = 1,
SecureConnectionsOnly = 2,
}
Expand description
The LE Security Mode of a BLE device determines the possible security properties of the device. The security mode does not make specific guarantees about the current security properties of a device’s connections; it sets restrictions on the allowable security properties. See Core Spec v5.2 Vol. 3, Part C 10.2 for more details.
Variants§
Mode1 = 1
In LE Security Mode 1, communication is secured by encryption, and BLE-based services may specify varying requirements for authentication, key size, or Secure Connections protection on the encryption keys.
SecureConnectionsOnly = 2
In Secure Connections Only mode, all secure communication must use 128 bit, authenticated, and LE Secure Connections-generated encryption keys. If these encryption key properties cannot be satisfied by a device due to system constraints, any connection involving such a device will not be able to secure the link at all. This mode does not prevent unencrypted communication; it merely enforces stricter policies on all encrypted communication.
Implementations§
source§impl LeSecurityMode
impl LeSecurityMode
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
source§impl Clone for LeSecurityMode
impl Clone for LeSecurityMode
source§fn clone(&self) -> LeSecurityMode
fn clone(&self) -> LeSecurityMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LeSecurityMode
impl Debug for LeSecurityMode
source§impl Decode<LeSecurityMode> for LeSecurityMode
impl Decode<LeSecurityMode> for LeSecurityMode
source§impl Encode<LeSecurityMode> for LeSecurityMode
impl Encode<LeSecurityMode> for LeSecurityMode
source§impl Hash for LeSecurityMode
impl Hash for LeSecurityMode
source§impl Ord for LeSecurityMode
impl Ord for LeSecurityMode
source§fn cmp(&self, other: &LeSecurityMode) -> Ordering
fn cmp(&self, other: &LeSecurityMode) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for LeSecurityMode
impl PartialEq for LeSecurityMode
source§fn eq(&self, other: &LeSecurityMode) -> bool
fn eq(&self, other: &LeSecurityMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for LeSecurityMode
impl PartialOrd for LeSecurityMode
source§fn partial_cmp(&self, other: &LeSecurityMode) -> Option<Ordering>
fn partial_cmp(&self, other: &LeSecurityMode) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TypeMarker for LeSecurityMode
impl TypeMarker for LeSecurityMode
§type Owned = LeSecurityMode
type Owned = LeSecurityMode
source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moresource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.source§impl ValueTypeMarker for LeSecurityMode
impl ValueTypeMarker for LeSecurityMode
§type Borrowed<'a> = LeSecurityMode
type Borrowed<'a> = LeSecurityMode
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more