Skip to main content

States

Struct States 

Source
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: bool

Everything outside it is inert while it is shown.

§focusable: bool

Can take keyboard focus.

§hidden: bool

Explicitly hidden, zero-sized, or under a hidden ancestor.

§offscreen: bool

Has size but is clipped out by a scrollable or the window.

§inert: bool

Outside the topmost modal.

Implementations§

Source§

impl States

Source

pub fn get(&self, state: StateName) -> Option<StateValue>

The value of a state, or None when no source reports it.

Source

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.

Source

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.

Source

pub fn known(&self) -> impl Iterator<Item = (StateName, StateValue)> + '_

Every state with a value, in StateName::ALL order.

Trait Implementations§

Source§

impl Clone for States

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for States

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for States

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for States

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for States

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for States

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for States

Auto Trait Implementations§

§

impl Forget for States

§

impl Freeze for States
where *const LeafNode<StateName, StateSource> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(StateName, StateSource)>>: Freeze,

§

impl Move for States

§

impl RefUnwindSafe for States

§

impl Send for States
where NodeRef<Owned, StateName, StateSource, LeafOrInternal>: Send, BoxRaw<(StateName, StateSource)>: Send,

§

impl Sync for States
where NodeRef<Owned, StateName, StateSource, LeafOrInternal>: Sync, BoxRaw<(StateName, StateSource)>: Sync,

§

impl Unpin for States
where *const LeafNode<StateName, StateSource> is !null: Unpin, Box<(StateName, StateSource)>: Unpin,

§

impl UnsafeUnpin for States
where *const LeafNode<StateName, StateSource> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(StateName, StateSource)>>: UnsafeUnpin,

§

impl UnwindSafe for States

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.