pub struct States {Show 18 fields
pub disabled: Option<bool>,
pub readonly: Option<bool>,
pub checked: Option<Checked>,
pub pressed: Option<bool>,
pub expanded: Option<bool>,
pub selected: Option<bool>,
pub focused: Option<bool>,
pub current: Option<bool>,
pub busy: Option<bool>,
pub required: Option<bool>,
pub invalid: Option<bool>,
pub multiline: Option<bool>,
pub multiselectable: Option<bool>,
pub modal: bool,
pub focusable: bool,
pub hidden: bool,
pub offscreen: bool,
pub inert: bool,
/* private fields */
}Expand description
A node’s states. None means no source could say; derived states are always known.
Fields§
§disabled: Option<bool>Takes no input.
readonly: Option<bool>Shows a value that cannot be changed.
checked: Option<Checked>Checked, unchecked or mixed.
pressed: Option<bool>A toggle button is pressed.
expanded: Option<bool>Content or a popup is shown.
selected: Option<bool>Selected in its container.
focused: Option<bool>Has keyboard focus.
current: Option<bool>The current item in a set.
busy: Option<bool>Loading or updating.
required: Option<bool>Must be filled in.
invalid: Option<bool>Its value is rejected.
multiline: Option<bool>Takes more than one line.
multiselectable: Option<bool>Allows more than one selected item.
modal: boolEverything outside it is inert while it is shown.
focusable: boolCan take keyboard focus.
Explicitly hidden, zero-sized, or under a hidden ancestor.
offscreen: boolHas size but is clipped out by a scrollable or the window.
inert: boolOutside the topmost modal.
Implementations§
Source§impl States
impl States
Sourcepub fn get(&self, state: StateName) -> Option<StateValue>
pub fn get(&self, state: StateName) -> Option<StateValue>
The value of a state, or None when no source reports it.
Sourcepub fn set(&mut self, state: StateName, value: StateValue, source: StateSource)
pub fn set(&mut self, state: StateName, value: StateValue, source: StateSource)
Sets a state and records its source. A mixed value on a state other than
StateName::Checked sets it to true.
Sourcepub fn source(&self, state: StateName) -> Option<StateSource>
pub fn source(&self, state: StateName) -> Option<StateSource>
Provenance of a known state, or None when the state itself is None. A derived flag
no source set reports StateSource::Derived.
Sourcepub fn known(&self) -> impl Iterator<Item = (StateName, StateValue)> + '_
pub fn known(&self) -> impl Iterator<Item = (StateName, StateValue)> + '_
Every state with a value, in StateName::ALL order.