pub struct Node<'a> {
pub tree_state: &'a State,
/* private fields */
}
Fields§
§tree_state: &'a State
Implementations§
source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub fn is_focused(&self) -> bool
pub fn is_focusable(&self) -> bool
pub fn is_root(&self) -> bool
pub fn parent_id(&self) -> Option<NodeId>
pub fn parent(&self) -> Option<Node<'a>>
pub fn filtered_parent( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
pub fn parent_and_index(self) -> Option<(Node<'a>, usize)>
pub fn child_ids( &self, ) -> impl DoubleEndedIterator<Item = NodeId> + ExactSizeIterator<Item = NodeId> + FusedIterator<Item = NodeId> + '_
pub fn children( &self, ) -> impl DoubleEndedIterator<Item = Node<'a>> + ExactSizeIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn filtered_children( &self, filter: impl Fn(&Node<'_>) -> FilterResult + 'a, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn following_sibling_ids( &self, ) -> impl DoubleEndedIterator<Item = NodeId> + ExactSizeIterator<Item = NodeId> + FusedIterator<Item = NodeId> + 'a
pub fn following_siblings( &self, ) -> impl DoubleEndedIterator<Item = Node<'a>> + ExactSizeIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn following_filtered_siblings( &self, filter: impl Fn(&Node<'_>) -> FilterResult + 'a, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn preceding_sibling_ids( &self, ) -> impl DoubleEndedIterator<Item = NodeId> + ExactSizeIterator<Item = NodeId> + FusedIterator<Item = NodeId> + 'a
pub fn preceding_siblings( &self, ) -> impl DoubleEndedIterator<Item = Node<'a>> + ExactSizeIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn preceding_filtered_siblings( &self, filter: impl Fn(&Node<'_>) -> FilterResult + 'a, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn deepest_first_child(self) -> Option<Node<'a>>
pub fn deepest_first_filtered_child( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
pub fn deepest_last_child(self) -> Option<Node<'a>>
pub fn deepest_last_filtered_child( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
pub fn is_descendant_of(&self, ancestor: &Node<'_>) -> bool
sourcepub fn direct_transform(&self) -> Affine
pub fn direct_transform(&self) -> Affine
Returns the transform defined directly on this node, or the identity transform, without taking into account transforms on ancestors.
sourcepub fn transform(&self) -> Affine
pub fn transform(&self) -> Affine
Returns the combined affine transform of this node and its ancestors, up to and including the root of this node’s tree.
pub fn raw_bounds(&self) -> Option<Rect>
pub fn has_bounds(&self) -> bool
sourcepub fn bounding_box(&self) -> Option<Rect>
pub fn bounding_box(&self) -> Option<Rect>
Returns the node’s transformed bounding box relative to the tree’s container (e.g. window).
sourcepub fn node_at_point(
&self,
point: Point,
filter: &impl Fn(&Node<'_>) -> FilterResult,
) -> Option<Node<'a>>
pub fn node_at_point( &self, point: Point, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
Returns the deepest filtered node, either this node or a descendant, at the given point in this node’s coordinate space.
pub fn id(&self) -> NodeId
pub fn role(&self) -> Role
pub fn role_description(&self) -> Option<String>
pub fn has_role_description(&self) -> bool
pub fn is_disabled(&self) -> bool
pub fn is_read_only(&self) -> bool
pub fn is_read_only_or_disabled(&self) -> bool
pub fn toggled(&self) -> Option<Toggled>
pub fn numeric_value(&self) -> Option<f64>
pub fn min_numeric_value(&self) -> Option<f64>
pub fn max_numeric_value(&self) -> Option<f64>
pub fn numeric_value_step(&self) -> Option<f64>
pub fn numeric_value_jump(&self) -> Option<f64>
pub fn is_text_input(&self) -> bool
pub fn is_multiline(&self) -> bool
pub fn orientation(&self) -> Option<Orientation>
pub fn default_action_verb(&self) -> Option<DefaultActionVerb>
pub fn is_clickable(&self) -> bool
pub fn supports_toggle(&self) -> bool
pub fn supports_expand_collapse(&self) -> bool
pub fn is_invocable(&self) -> bool
pub fn supports_increment(&self) -> bool
pub fn supports_decrement(&self) -> bool
source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub fn labelled_by( &self, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn name(&self) -> Option<String>
pub fn description(&self) -> Option<String>
pub fn placeholder(&self) -> Option<String>
pub fn value(&self) -> Option<String>
pub fn has_value(&self) -> bool
pub fn is_read_only_supported(&self) -> bool
pub fn should_have_read_only_state_by_default(&self) -> bool
pub fn live(&self) -> Live
pub fn is_selected(&self) -> Option<bool>
pub fn raw_text_selection(&self) -> Option<&TextSelection>
pub fn raw_value(&self) -> Option<&str>
pub fn class_name(&self) -> Option<&str>
pub fn index_path(&self) -> Vec<usize>
pub fn relative_index_path(&self, ancestor_id: NodeId) -> Vec<usize>
source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub fn supports_text_ranges(&self) -> bool
pub fn document_range(&self) -> Range<'_>
pub fn has_text_selection(&self) -> bool
pub fn text_selection(&self) -> Option<Range<'_>>
pub fn text_selection_focus(&self) -> Option<Position<'_>>
sourcepub fn text_position_at_point(&self, point: Point) -> Position<'_>
pub fn text_position_at_point(&self, point: Point) -> Position<'_>
Returns the nearest text position to the given point in this node’s coordinate space.
pub fn line_range_from_index(&self, line_index: usize) -> Option<Range<'_>>
pub fn text_position_from_global_usv_index( &self, index: usize, ) -> Option<Position<'_>>
pub fn text_position_from_global_utf16_index( &self, index: usize, ) -> Option<Position<'_>>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Node<'a>
impl<'a> RefUnwindSafe for Node<'a>
impl<'a> Send for Node<'a>
impl<'a> Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> UnwindSafe for Node<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)