Skip to main content

AccessNode

Struct AccessNode 

Source
pub struct AccessNode {
Show 30 fields pub key: Key, pub parent: Option<Key>, pub origin: OriginId, pub role: Role, pub name: Option<String>, pub description: Option<String>, pub rect: Rect, pub value: Option<String>, pub caret: Option<usize>, pub selection: Option<(usize, usize)>, pub runs: Vec<AccessRun>, pub anchor: Option<TextPos>, pub focus: Option<TextPos>, pub checked: Option<bool>, pub mixed: bool, pub selected: Option<bool>, pub expanded: Option<bool>, pub pos_in_set: Option<usize>, pub orientation: Option<Orientation>, pub set_size: Option<usize>, pub number: Option<f32>, pub min: Option<f32>, pub max: Option<f32>, pub step: Option<f32>, pub focused: bool, pub disabled: bool, pub modal: bool, pub scroll: Option<ScrollState>, pub actions: u32, pub live: Live,
}
Expand description

One semantic node of a frame.

Fields§

§key: Key§parent: Option<Key>

The nearest semantic ancestor; None for the root.

§origin: OriginId§role: Role§name: Option<String>

The accessible name: label, else the node’s own text, else (for presentational roles) the text inside it, else the window title for the root.

§description: Option<String>

description on the spec — the description prop, or a tooltip.

§rect: Rect

Final laid-out rect, logical px, viewport coordinates, cut to the clip the node is drawn under — the one its hit region carries — so a reader’s hover finds only what a pointer could. A node wholly clipped away is a zero-size rect on the clip’s edge nearest it: still in the tree, still actionable, never hit.

§value: Option<String>

The node’s string value, which the platform has exactly one slot for: an editor’s committed text (a custom editor’s: the lines it draws, joined by "\n"), or a slider’s declared value_text. A slider that names its reading has only that reading — the string wins over the number wherever both could be said, which is what aria-valuetext means and what accesskit_macos does with AXValue. min / max are unaffected, and so are the increment actions.

§caret: Option<usize>

An editor’s caret, a byte offset into value.

§selection: Option<(usize, usize)>

An editor’s non-empty selection as byte offsets into value.

§runs: Vec<AccessRun>

An editor’s laid-out text, run by run (see AccessRun).

§anchor: Option<TextPos>

The caret (focus) and the other end of the selection (anchor, equal to focus without one) as run positions.

§focus: Option<TextPos>§checked: Option<bool>

checked for checkbox / radio / switch roles.

§mixed: bool

A checkbox that is neither on nor off: reported as mixed whatever checked says.

§selected: Option<bool>

The current one of a set: every tab carries it, a listItem or a link only where the view set it (an ordinary list is not a selection, and “not selected” on every row of one is noise). None = the node has no such state.

§expanded: Option<bool>

A disclosure’s state, exactly as declared. None = it does not expand, and a reader says nothing about it.

§pos_in_set: Option<usize>

“3 of 7”: this node’s zero-based ordinal among the items of the list / tabList holding it, with set_size on that container. Derived, never declared — the core counts the semantic children it already has (see set_size).

§orientation: Option<Orientation>

How a composite container arranges its items, from its dir (see Orientation). None = the node is not one of the four composite containers, and says nothing about arrangement.

§set_size: Option<usize>

On a list / tabList: how many items it holds. AccessKit puts the count on the container and the ordinal on the item, unlike ARIA’s aria-setsize on every item; this follows AccessKit.

§number: Option<f32>

valueNow / valueMin / valueMax for a slider. What the position reads as is valueText, which lands in value above because the platform has one string slot for both.

§min: Option<f32>§max: Option<f32>§step: Option<f32>

A slider’s valueStep, where it declared one.

§focused: bool

Holds keyboard focus (Core::focus).

§disabled: bool

Declared disabled: inert, and not in the Tab ring.

§modal: bool

The frame’s modal surface (aria-modal): the Tab ring and every pointer are confined to it, and everything else is inert. Only the modal in effect carries it — the last one declared — so a confirm inside a dialog leaves the dialog an ordinary node.

§scroll: Option<ScrollState>§actions: u32

Bitset of AccessAction::bit.

§live: Live

Declared live: when the text inside this node changes, a reader reads the change without being asked. Carried exactly where the view declared it — the platform consumer inherits it down the subtree, and duplicating that here would be a second copy of a rule kui does not own.

Implementations§

Source§

impl AccessNode

Source

pub fn to_value(&self, h: Handles) -> Value

The node as plain data, every field under its snake_case name and every key spelled by h. The slider’s numbers are value_now, value_min, value_max — the rows that set them, not the fields that hold them; actions is the list of action names, live and role and orientation their schema names.

Source

pub fn supports(&self, action: AccessAction) -> bool

Source

pub fn action_list(&self) -> Vec<AccessAction>

The actions this node advertises.

Source

pub fn line_offset(&self, pos: TextPos) -> Option<(usize, usize)>

Turns a run position back into the line it is on and a byte offset into that line’s text (the "\n" counting as the line’s end).

Source

pub fn text_pos(&self, line: usize, offset: usize) -> Option<TextPos>

The run position of a byte offset into line line’s text: the run holding it, or the line’s last run for its end.

Trait Implementations§

Source§

impl Clone for AccessNode

Source§

fn clone(&self) -> AccessNode

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 AccessNode

Source§

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

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

impl PartialEq for AccessNode

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AccessNode

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more