pub struct Settings { /* private fields */ }
Implementations§
Source§impl Settings
impl Settings
pub const Powered: Self
pub const Connectable: Self
pub const FastConnectable: Self
pub const Discoverable: Self
pub const Bondable: Self
pub const LinkLevelSecurity: Self
pub const SecureSimplePairing: Self
pub const BasicRateEnhancedDataRate: Self
pub const HighSpeed: Self
pub const LowEnergy: Self
pub const Advertising: Self
pub const SecureConnections: Self
pub const DebugKeys: Self
pub const Privacy: Self
pub const ControllerConfiguration: Self
pub const StaticAddress: Self
pub const PhyConfiguration: Self
pub const WidebandSpeech: Self
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Self
pub const unsafe fn from_bits_unchecked(bits: u32) -> Self
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
§Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true
if all of the flags in other
are contained within self
.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
Source§impl AsMut<Settings> for NewSettings
impl AsMut<Settings> for NewSettings
Source§impl AsMut<Settings> for SetAdvertisingReply
impl AsMut<Settings> for SetAdvertisingReply
Source§impl AsMut<Settings> for SetBondableReply
impl AsMut<Settings> for SetBondableReply
Source§impl AsMut<Settings> for SetBrEdrReply
impl AsMut<Settings> for SetBrEdrReply
Source§impl AsMut<Settings> for SetConnectableReply
impl AsMut<Settings> for SetConnectableReply
Source§impl AsMut<Settings> for SetDebugKeysReply
impl AsMut<Settings> for SetDebugKeysReply
Source§impl AsMut<Settings> for SetDiscoverableReply
impl AsMut<Settings> for SetDiscoverableReply
Source§impl AsMut<Settings> for SetFastConnectableReply
impl AsMut<Settings> for SetFastConnectableReply
Source§impl AsMut<Settings> for SetHighSpeedReply
impl AsMut<Settings> for SetHighSpeedReply
Source§impl AsMut<Settings> for SetLinkSecurityReply
impl AsMut<Settings> for SetLinkSecurityReply
Source§impl AsMut<Settings> for SetLowEnergyReply
impl AsMut<Settings> for SetLowEnergyReply
Source§impl AsMut<Settings> for SetPoweredReply
impl AsMut<Settings> for SetPoweredReply
Source§impl AsMut<Settings> for SetPrivacyReply
impl AsMut<Settings> for SetPrivacyReply
Source§impl AsMut<Settings> for SetSecureConnectionsReply
impl AsMut<Settings> for SetSecureConnectionsReply
Source§impl AsMut<Settings> for SetSecureSimplePairingReply
impl AsMut<Settings> for SetSecureSimplePairingReply
Source§impl AsMut<Settings> for SetStaticAddressReply
impl AsMut<Settings> for SetStaticAddressReply
Source§impl AsMut<Settings> for SetWidbandSpeechReply
impl AsMut<Settings> for SetWidbandSpeechReply
Source§impl AsRef<Settings> for NewSettings
impl AsRef<Settings> for NewSettings
Source§impl AsRef<Settings> for SetAdvertisingReply
impl AsRef<Settings> for SetAdvertisingReply
Source§impl AsRef<Settings> for SetBondableReply
impl AsRef<Settings> for SetBondableReply
Source§impl AsRef<Settings> for SetBrEdrReply
impl AsRef<Settings> for SetBrEdrReply
Source§impl AsRef<Settings> for SetConnectableReply
impl AsRef<Settings> for SetConnectableReply
Source§impl AsRef<Settings> for SetDebugKeysReply
impl AsRef<Settings> for SetDebugKeysReply
Source§impl AsRef<Settings> for SetDiscoverableReply
impl AsRef<Settings> for SetDiscoverableReply
Source§impl AsRef<Settings> for SetFastConnectableReply
impl AsRef<Settings> for SetFastConnectableReply
Source§impl AsRef<Settings> for SetHighSpeedReply
impl AsRef<Settings> for SetHighSpeedReply
Source§impl AsRef<Settings> for SetLinkSecurityReply
impl AsRef<Settings> for SetLinkSecurityReply
Source§impl AsRef<Settings> for SetLowEnergyReply
impl AsRef<Settings> for SetLowEnergyReply
Source§impl AsRef<Settings> for SetPoweredReply
impl AsRef<Settings> for SetPoweredReply
Source§impl AsRef<Settings> for SetPrivacyReply
impl AsRef<Settings> for SetPrivacyReply
Source§impl AsRef<Settings> for SetSecureConnectionsReply
impl AsRef<Settings> for SetSecureConnectionsReply
Source§impl AsRef<Settings> for SetSecureSimplePairingReply
impl AsRef<Settings> for SetSecureSimplePairingReply
Source§impl AsRef<Settings> for SetStaticAddressReply
impl AsRef<Settings> for SetStaticAddressReply
Source§impl AsRef<Settings> for SetWidbandSpeechReply
impl AsRef<Settings> for SetWidbandSpeechReply
Source§impl BitAndAssign for Settings
impl BitAndAssign for Settings
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Settings
impl BitOrAssign for Settings
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
Source§impl BitXorAssign for Settings
impl BitXorAssign for Settings
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
Source§impl Extend<Settings> for Settings
impl Extend<Settings> for Settings
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl From<Settings> for NewSettings
impl From<Settings> for NewSettings
Source§impl From<Settings> for SetAdvertisingReply
impl From<Settings> for SetAdvertisingReply
Source§impl From<Settings> for SetBondableReply
impl From<Settings> for SetBondableReply
Source§impl From<Settings> for SetBrEdrReply
impl From<Settings> for SetBrEdrReply
Source§impl From<Settings> for SetConnectableReply
impl From<Settings> for SetConnectableReply
Source§impl From<Settings> for SetDebugKeysReply
impl From<Settings> for SetDebugKeysReply
Source§impl From<Settings> for SetDiscoverableReply
impl From<Settings> for SetDiscoverableReply
Source§impl From<Settings> for SetFastConnectableReply
impl From<Settings> for SetFastConnectableReply
Source§impl From<Settings> for SetHighSpeedReply
impl From<Settings> for SetHighSpeedReply
Source§impl From<Settings> for SetLinkSecurityReply
impl From<Settings> for SetLinkSecurityReply
Source§impl From<Settings> for SetLowEnergyReply
impl From<Settings> for SetLowEnergyReply
Source§impl From<Settings> for SetPoweredReply
impl From<Settings> for SetPoweredReply
Source§impl From<Settings> for SetPrivacyReply
impl From<Settings> for SetPrivacyReply
Source§impl From<Settings> for SetSecureConnectionsReply
impl From<Settings> for SetSecureConnectionsReply
Source§impl From<Settings> for SetSecureSimplePairingReply
impl From<Settings> for SetSecureSimplePairingReply
Source§impl From<Settings> for SetStaticAddressReply
impl From<Settings> for SetStaticAddressReply
Source§impl From<Settings> for SetWidbandSpeechReply
impl From<Settings> for SetWidbandSpeechReply
Source§impl FromIterator<Settings> for Settings
impl FromIterator<Settings> for Settings
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
Source§impl Ord for Settings
impl Ord for Settings
Source§impl PartialOrd for Settings
impl PartialOrd for Settings
Source§impl SubAssign for Settings
impl SubAssign for Settings
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.