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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
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>
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)
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)
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> DowncastSync for T
impl<T> DowncastSync for T
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