Struct AccessState
pub struct AccessState {Show 16 fields
pub focused: bool,
pub focusable: bool,
pub context_menu: bool,
pub selected: bool,
pub checked: Option<bool>,
pub mixed: bool,
pub expanded: Option<bool>,
pub disabled: bool,
pub read_only: bool,
pub required: bool,
pub invalid: bool,
pub busy: bool,
pub modal: bool,
pub hidden: bool,
pub multiline: bool,
pub protected: bool,
}Expand description
Tri-state fields use Option<bool> where None means “the state does
not apply” (e.g. a Role::Button is never checked) — matching ARIA’s
aria-checked="false" vs. absent distinction.
State is derived, never stored: a widget computes it from its
existing fields at accessibility() time, so it can never drift from
what draw paints.
Fields§
§focused: bool§focusable: boolThe control owns a standard context menu. The bridge exposes
AccessKit/AT-SPI’s ShowContextMenu verb only when this is true, so
canvas-style apps can make a menu discoverable without claiming that
every focusable list row has one.
selected: bool§checked: Option<bool>None = not checkable; tri-state goes through AccessState::mixed, not a third value here.
mixed: bool“Partially checked” / indeterminate, for tri-state checkboxes.
expanded: Option<bool>None = not expandable.
disabled: bool§read_only: bool§required: bool§invalid: bool§busy: boolThe element or its subtree.
modal: boolTraps focus.
Hidden from view, and should be from the tree.
multiline: bool§protected: boolWhen set, widgets must NOT place the secret in AccessNode::value.
Implementations§
§impl AccessState
impl AccessState
pub fn new() -> AccessState
pub fn focused(self, v: bool) -> AccessState
pub fn focusable(self, v: bool) -> AccessState
Advertise a standard context-menu action for this control.
pub fn selected(self, v: bool) -> AccessState
pub fn checked(self, v: bool) -> AccessState
pub fn checked(self, v: bool) -> AccessState
Sets checked to Some(v).
pub fn expanded(self, v: bool) -> AccessState
pub fn expanded(self, v: bool) -> AccessState
Sets expanded to Some(v).
pub fn disabled(self, v: bool) -> AccessState
pub fn read_only(self, v: bool) -> AccessState
pub fn multiline(self, v: bool) -> AccessState
pub fn protected(self, v: bool) -> AccessState
pub fn modal(self, v: bool) -> AccessState
pub fn busy(self, v: bool) -> AccessState
Trait Implementations§
§impl Clone for AccessState
impl Clone for AccessState
§fn clone(&self) -> AccessState
fn clone(&self) -> AccessState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for AccessState
impl Debug for AccessState
§impl Default for AccessState
impl Default for AccessState
§fn default() -> AccessState
fn default() -> AccessState
§impl PartialEq for AccessState
impl PartialEq for AccessState
§impl Serialize for AccessState
impl Serialize for AccessState
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for AccessState
impl Eq for AccessState
impl StructuralPartialEq for AccessState
Auto Trait Implementations§
impl Freeze for AccessState
impl RefUnwindSafe for AccessState
impl Send for AccessState
impl Sync for AccessState
impl Unpin for AccessState
impl UnsafeUnpin for AccessState
impl UnwindSafe for AccessState
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more