pub struct A11ySubtreeBuilder<'a> { /* private fields */ }Expand description
Builder API for synthetic children. See the docs for
Element::a11y_synthetic_children.
Implementations§
Source§impl<'a> A11ySubtreeBuilder<'a>
impl<'a> A11ySubtreeBuilder<'a>
Sourcepub fn synthetic_node_id(&self, key: impl Hash) -> NodeId
pub fn synthetic_node_id(&self, key: impl Hash) -> NodeId
Derive a NodeId for a synthetic child.
The generated ID is based on the hash of key, as well as the parent’s
ID. This means that keys must be unique within the same
Element::a11y_synthetic_children call, but may be duplicated across
different calls.
Sourcepub fn push_child(&mut self, id: NodeId, node: Node) -> bool
pub fn push_child(&mut self, id: NodeId, node: Node) -> bool
Append a synthetic leaf node as a child of this element’s node.
Returns false if a node with this id is already present in the tree,
in which case the node is discarded.
Sourcepub fn parent_node(&mut self) -> &mut Node
pub fn parent_node(&mut self) -> &mut Node
A mutable reference to the parent node.
Auto Trait Implementations§
impl<'a> !UnwindSafe for A11ySubtreeBuilder<'a>
impl<'a> Freeze for A11ySubtreeBuilder<'a>
impl<'a> RefUnwindSafe for A11ySubtreeBuilder<'a>
impl<'a> Send for A11ySubtreeBuilder<'a>
impl<'a> Sync for A11ySubtreeBuilder<'a>
impl<'a> Unpin for A11ySubtreeBuilder<'a>
impl<'a> UnsafeUnpin for A11ySubtreeBuilder<'a>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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