[−]Struct rubble::link::FeatureSet
A set of optional Link Layer features.
Methods
impl FeatureSet
pub const LE_ENCRYPTION: FeatureSet
Low-Energy data encryption.
Setting this bit means that the implementation must support the following:
- The following types of LL Control PDUs:
LL_ENC_REQ
,LL_ENC_RSP
,LL_START_ENC_REQ
,LL_START_END_RSP
,LL_PAUSE_ENC_REQ
,LL_PAUSE_ENC_RSP
. - Encryption Start and Encryption Pause procedures.
Note that the Security Manager Protocol also needs to be implemented for this to be useful.
pub const CONN_PARAM_REQ: FeatureSet
Connection parameters request procedure.
Setting this bit means that the implementation must support the following:
- The following types of LL Control PDUs:
LL_REJECT_IND_EXT
,LL_CONNECTION_PARAM_REQ
,LL_CONNECTION_PARAM_RSP
. - Connection Parameters Request Procedure
This is a superset of EXTENDED_REJECT_INDICATION
, which may also be set when this bit
is set.
pub const EXTENDED_REJECT_INDICATION: FeatureSet
Support for the LL Control PDU LL_REJECT_IND_EXT
.
pub const SLAVE_FEATURE_EXCHANGE: FeatureSet
Slave-initiated feature exchange.
Setting this bit means that the implementation must support the following:
- The following types of LL Control PDUs:
LL_SLAVE_FEATURE_REQ
,LL_FEATURE_RSP
.
TODO: What's the use of this?
pub const LE_PING: FeatureSet
Low-Energy Link-Layer ping exchange.
Setting this bit means that the implementation must support the following:
- The following types of LL Control PDUs:
LL_PING_REQ
,LL_PING_RSP
. - The LE Ping Procedure
- LE Authenticated Payload Timeout
If a Link-Layer is in idle state, it will transmit empty PDUs, which are never
authenticated with a MIC. Supporting this feature allows configuring a timeout between
authenticated packets, since dummy data can then be sent via LL_PING_REQ
.
pub const LE_PACKET_LENGTH_EXTENSION: FeatureSet
Link-Layer PDU length update (support for data channel PDUs with more than 31 Bytes).
Setting this bit means that the implementation must support the following:
- The following types of LL Control PDUs:
LL_LENGTH_REQ
,LL_LENGTH_RSP
- The Data Length Update Procedure
pub const LL_PRIVACY: FeatureSet
Support for untrackable randomized device addresses (LL Privacy).
pub const EXT_SCANNER_FILTER_POLICIES: FeatureSet
Extended scan filter policies.
pub fn empty() -> FeatureSet
Returns an empty set of flags.
pub fn all() -> FeatureSet
Returns the set containing all flags.
pub fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u64) -> Option<FeatureSet>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u64) -> FeatureSet
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: FeatureSet) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: FeatureSet) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: FeatureSet)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: FeatureSet)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: FeatureSet)
Toggles the specified flags in-place.
pub fn set(&mut self, other: FeatureSet, value: bool)
Inserts or removes the specified flags depending on the passed value.
impl FeatureSet
[src]
Trait Implementations
impl ToBytes for FeatureSet
[src]
fn to_bytes(&self, writer: &mut ByteWriter) -> Result<(), Error>
[src]
impl<'a> FromBytes<'a> for FeatureSet
[src]
fn from_bytes(bytes: &mut ByteReader<'a>) -> Result<Self, Error>
[src]
impl Copy for FeatureSet
impl Debug for FeatureSet
impl PartialEq<FeatureSet> for FeatureSet
fn eq(&self, other: &FeatureSet) -> bool
fn ne(&self, other: &FeatureSet) -> bool
impl Eq for FeatureSet
impl Ord for FeatureSet
fn cmp(&self, other: &FeatureSet) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl PartialOrd<FeatureSet> for FeatureSet
fn partial_cmp(&self, other: &FeatureSet) -> Option<Ordering>
fn lt(&self, other: &FeatureSet) -> bool
fn le(&self, other: &FeatureSet) -> bool
fn gt(&self, other: &FeatureSet) -> bool
fn ge(&self, other: &FeatureSet) -> bool
impl Sub<FeatureSet> for FeatureSet
type Output = FeatureSet
The resulting type after applying the -
operator.
fn sub(self, other: FeatureSet) -> FeatureSet
Returns the set difference of the two sets of flags.
impl SubAssign<FeatureSet> for FeatureSet
fn sub_assign(&mut self, other: FeatureSet)
Disables all flags enabled in the set.
impl Not for FeatureSet
type Output = FeatureSet
The resulting type after applying the !
operator.
fn not(self) -> FeatureSet
Returns the complement of this set of flags.
impl BitAnd<FeatureSet> for FeatureSet
type Output = FeatureSet
The resulting type after applying the &
operator.
fn bitand(self, other: FeatureSet) -> FeatureSet
Returns the intersection between the two sets of flags.
impl BitOr<FeatureSet> for FeatureSet
type Output = FeatureSet
The resulting type after applying the |
operator.
fn bitor(self, other: FeatureSet) -> FeatureSet
Returns the union of the two sets of flags.
impl BitXor<FeatureSet> for FeatureSet
type Output = FeatureSet
The resulting type after applying the ^
operator.
fn bitxor(self, other: FeatureSet) -> FeatureSet
Returns the left flags, but with all the right flags toggled.
impl BitAndAssign<FeatureSet> for FeatureSet
fn bitand_assign(&mut self, other: FeatureSet)
Disables all flags disabled in the set.
impl BitOrAssign<FeatureSet> for FeatureSet
fn bitor_assign(&mut self, other: FeatureSet)
Adds the set of flags.
impl BitXorAssign<FeatureSet> for FeatureSet
fn bitxor_assign(&mut self, other: FeatureSet)
Toggles the set of flags.
impl Hash for FeatureSet
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl FromIterator<FeatureSet> for FeatureSet
fn from_iter<T: IntoIterator<Item = FeatureSet>>(iterator: T) -> FeatureSet
impl Extend<FeatureSet> for FeatureSet
fn extend<T: IntoIterator<Item = FeatureSet>>(&mut self, iterator: T)
impl Octal for FeatureSet
impl Binary for FeatureSet
impl LowerHex for FeatureSet
impl UpperHex for FeatureSet
impl Clone for FeatureSet
fn clone(&self) -> FeatureSet
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl Send for FeatureSet
impl Sync for FeatureSet
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,