Skip to main content

ModifierChainNodeRef

Struct ModifierChainNodeRef 

Source
pub struct ModifierChainNodeRef<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ModifierChainNodeRef<'a>

Source

pub fn with_node<R>(&self, f: impl FnOnce(&dyn ModifierNode) -> R) -> Option<R>

Provides access to the node via a closure, properly handling RefCell borrows. Returns None for sentinel nodes.

Source

pub fn parent(&self) -> Option<Self>

Returns the parent reference, including sentinel head when applicable.

Source

pub fn child(&self) -> Option<Self>

Returns the child reference, including sentinel tail for the last entry.

Source

pub fn kind_set(&self) -> NodeCapabilities

Returns the capability mask for this specific node.

Source

pub fn entry_index(&self) -> Option<usize>

Returns the entry index backing this node when it is part of the chain.

Source

pub fn delegate_depth(&self) -> usize

Returns how many delegate hops separate this node from its root element.

Source

pub fn aggregate_child_capabilities(&self) -> NodeCapabilities

Returns the aggregated capability mask for the subtree rooted at this node.

Source

pub fn is_head(&self) -> bool

Returns true if this reference targets the sentinel head.

Source

pub fn is_tail(&self) -> bool

Returns true if this reference targets the sentinel tail.

Source

pub fn is_sentinel(&self) -> bool

Returns true if this reference targets either sentinel.

Source

pub fn has_capability(&self, mask: NodeCapabilities) -> bool

Returns true if this node has any capability bits present in mask.

Source

pub fn visit_descendants<F>(self, include_self: bool, f: F)

Visits descendant nodes, optionally including self, in insertion order.

Source

pub fn visit_descendants_matching<F>( self, include_self: bool, mask: NodeCapabilities, f: F, )

Visits descendant nodes that match mask, short-circuiting when possible.

Source

pub fn visit_ancestors<F>(self, include_self: bool, f: F)

Visits ancestor nodes up to (but excluding) the sentinel head.

Source

pub fn visit_ancestors_matching<F>( self, include_self: bool, mask: NodeCapabilities, f: F, )

Visits ancestor nodes that match mask.

Source

pub fn find_parent_focus_target(&self) -> Option<ModifierChainNodeRef<'a>>

Finds the nearest ancestor focus target node.

This is useful for focus navigation to find the parent focusable component in the tree.

Source

pub fn find_first_focus_target(&self) -> Option<ModifierChainNodeRef<'a>>

Finds the first descendant focus target node.

This is useful for focus navigation to find the first focusable child component in the tree.

Source

pub fn has_focus_capability_in_ancestors(&self) -> bool

Returns true if this node or any ancestor has focus capability.

Trait Implementations§

Source§

impl<'a> Clone for ModifierChainNodeRef<'a>

Source§

fn clone(&self) -> ModifierChainNodeRef<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more

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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.