pub struct UserActiveModeTrigger(/* private fields */);rustcrypto only.Expand description
§9.16.5.1’s UserActiveModeTriggerBitmap: how a person wakes the device.
A client shows this to a user who is waiting for a sleepy device to answer, so the
value is a user interface rather than a capability — which is why several bits carry
a dependency on UserActiveModeTriggerInstruction: “Press the reset button for N
seconds” is useless without N.
Implementations§
Source§impl UserActiveModeTrigger
impl UserActiveModeTrigger
Sourcepub const POWER_CYCLE: Self
pub const POWER_CYCLE: Self
Power-cycling the device wakes it.
Sourcepub const SETTINGS_MENU: Self
pub const SETTINGS_MENU: Self
The device’s own settings menu explains how.
Sourcepub const CUSTOM_INSTRUCTION: Self
pub const CUSTOM_INSTRUCTION: Self
UserActiveModeTriggerInstruction describes a custom way. Requires it.
Sourcepub const DEVICE_MANUAL: Self
pub const DEVICE_MANUAL: Self
The device manual explains how.
Sourcepub const ACTUATE_SENSOR: Self
pub const ACTUATE_SENSOR: Self
Actuating the sensor wakes it — opening the door, for a door sensor.
Sourcepub const ACTUATE_SENSOR_SECONDS: Self
pub const ACTUATE_SENSOR_SECONDS: Self
Actuating the sensor for N seconds. Requires the instruction.
Sourcepub const ACTUATE_SENSOR_TIMES: Self
pub const ACTUATE_SENSOR_TIMES: Self
Actuating the sensor N times. Requires the instruction.
Sourcepub const ACTUATE_SENSOR_LIGHTS_BLINK: Self
pub const ACTUATE_SENSOR_LIGHTS_BLINK: Self
Actuating the sensor until a light blinks.
Sourcepub const RESET_BUTTON: Self
pub const RESET_BUTTON: Self
Pressing the reset button.
Sourcepub const RESET_BUTTON_LIGHTS_BLINK: Self
pub const RESET_BUTTON_LIGHTS_BLINK: Self
Pressing the reset button until a light blinks.
Sourcepub const RESET_BUTTON_SECONDS: Self
pub const RESET_BUTTON_SECONDS: Self
Pressing the reset button for N seconds. Requires the instruction.
Sourcepub const RESET_BUTTON_TIMES: Self
pub const RESET_BUTTON_TIMES: Self
Pressing the reset button N times. Requires the instruction.
Sourcepub const SETUP_BUTTON: Self
pub const SETUP_BUTTON: Self
Pressing the setup button.
Sourcepub const SETUP_BUTTON_SECONDS: Self
pub const SETUP_BUTTON_SECONDS: Self
Pressing the setup button for N seconds. Requires the instruction.
Sourcepub const SETUP_BUTTON_LIGHTS_BLINK: Self
pub const SETUP_BUTTON_LIGHTS_BLINK: Self
Pressing the setup button until a light blinks.
Sourcepub const SETUP_BUTTON_TIMES: Self
pub const SETUP_BUTTON_TIMES: Self
Pressing the setup button N times. Requires the instruction.
Sourcepub const APP_DEFINED_BUTTON: Self
pub const APP_DEFINED_BUTTON: Self
Pressing an application-defined button. Requires the instruction.
Source§impl UserActiveModeTrigger
impl UserActiveModeTrigger
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> Self
pub const fn from_bits_retain(bits: u32) -> Self
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in other are also set in self.
Sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in other are also set in self.
Sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&) of the bits in self and other.
Sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|) of the bits in self and other.
Sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!) of the bits in self, truncating the result.
Source§impl UserActiveModeTrigger
impl UserActiveModeTrigger
Sourcepub const fn iter(&self) -> Iter<UserActiveModeTrigger> ⓘ
pub const fn iter(&self) -> Iter<UserActiveModeTrigger> ⓘ
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<UserActiveModeTrigger> ⓘ
pub const fn iter_names(&self) -> IterNames<UserActiveModeTrigger> ⓘ
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Source§impl UserActiveModeTrigger
impl UserActiveModeTrigger
Sourcepub const REQUIRE_INSTRUCTION: Self
pub const REQUIRE_INSTRUCTION: Self
The bits §9.16.6.7 says require UserActiveModeTriggerInstruction to be present.
Three bits that depend on the instruction do not require it — “ActuateSensorLightsBlink, ResetButtonLightsBlink and SetupButtonLightsBlink (i.e. bits 7, 9 and 14) have a dependency on the UserActiveModeTriggerInstruction attribute but do not require the attribute to be present” — because the instruction only adds the colour of the light. They are excluded here.
Sourcepub const fn needs_instruction(self) -> bool
pub const fn needs_instruction(self) -> bool
Whether this hint obliges the device to publish an instruction string.
Trait Implementations§
Source§impl Binary for UserActiveModeTrigger
impl Binary for UserActiveModeTrigger
Source§impl BitAnd for UserActiveModeTrigger
impl BitAnd for UserActiveModeTrigger
Source§impl BitAndAssign for UserActiveModeTrigger
impl BitAndAssign for UserActiveModeTrigger
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&) of the bits in self and other.
Source§impl BitOr for UserActiveModeTrigger
impl BitOr for UserActiveModeTrigger
Source§fn bitor(self, other: UserActiveModeTrigger) -> Self
fn bitor(self, other: UserActiveModeTrigger) -> Self
The bitwise or (|) of the bits in self and other.
Source§type Output = UserActiveModeTrigger
type Output = UserActiveModeTrigger
| operator.Source§impl BitOrAssign for UserActiveModeTrigger
impl BitOrAssign for UserActiveModeTrigger
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|) of the bits in self and other.
Source§impl BitXor for UserActiveModeTrigger
impl BitXor for UserActiveModeTrigger
Source§impl BitXorAssign for UserActiveModeTrigger
impl BitXorAssign for UserActiveModeTrigger
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^) of the bits in self and other.
Source§impl Clone for UserActiveModeTrigger
impl Clone for UserActiveModeTrigger
impl Copy for UserActiveModeTrigger
Source§impl Debug for UserActiveModeTrigger
impl Debug for UserActiveModeTrigger
Source§impl Default for UserActiveModeTrigger
impl Default for UserActiveModeTrigger
impl Eq for UserActiveModeTrigger
Source§impl Extend<UserActiveModeTrigger> for UserActiveModeTrigger
impl Extend<UserActiveModeTrigger> for UserActiveModeTrigger
Source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Flags for UserActiveModeTrigger
impl Flags for UserActiveModeTrigger
Source§const FLAGS: &'static [Flag<UserActiveModeTrigger>]
const FLAGS: &'static [Flag<UserActiveModeTrigger>]
Source§fn from_bits_retain(bits: u32) -> UserActiveModeTrigger
fn from_bits_retain(bits: u32) -> UserActiveModeTrigger
Source§fn all_named() -> UserActiveModeTrigger
fn all_named() -> UserActiveModeTrigger
Source§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
Source§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
Source§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
Source§fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
Self::FLAGS.Source§fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.Source§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
Source§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.Source§impl FromIterator<UserActiveModeTrigger> for UserActiveModeTrigger
impl FromIterator<UserActiveModeTrigger> for UserActiveModeTrigger
Source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|) of the bits in each flags value.
Source§impl Hash for UserActiveModeTrigger
impl Hash for UserActiveModeTrigger
Source§impl IntoIterator for UserActiveModeTrigger
impl IntoIterator for UserActiveModeTrigger
Source§impl LowerHex for UserActiveModeTrigger
impl LowerHex for UserActiveModeTrigger
Source§impl Not for UserActiveModeTrigger
impl Not for UserActiveModeTrigger
Source§impl Octal for UserActiveModeTrigger
impl Octal for UserActiveModeTrigger
Source§impl PartialEq for UserActiveModeTrigger
impl PartialEq for UserActiveModeTrigger
Source§impl PublicFlags for UserActiveModeTrigger
impl PublicFlags for UserActiveModeTrigger
impl StructuralPartialEq for UserActiveModeTrigger
Source§impl Sub for UserActiveModeTrigger
impl Sub for UserActiveModeTrigger
Source§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = UserActiveModeTrigger
type Output = UserActiveModeTrigger
- operator.Source§impl SubAssign for UserActiveModeTrigger
impl SubAssign for UserActiveModeTrigger
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.