pub struct Node<'a> {
pub tree_state: &'a State,
pub(crate) id: NodeId,
pub(crate) state: &'a NodeState,
}Fields§
§tree_state: &'a State§id: NodeId§state: &'a NodeStateImplementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub fn data(&self) -> &'a NodeData
pub fn is_focused(&self) -> bool
pub fn is_focused_in_tree(&self) -> bool
pub fn is_focusable( &self, parent_filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> 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(crate) fn relative_transform(&self, stop_at: &Node<'_>) -> Affine
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).
pub(crate) fn bounding_box_in_coordinate_space( &self, other: &Node<'_>, ) -> Option<Rect>
pub(crate) fn hit_test( &self, point: Point, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<(Node<'a>, Point)>
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<&str>
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 clips_children(&self) -> bool
pub fn scroll_x(&self) -> Option<f64>
pub fn scroll_x_min(&self) -> Option<f64>
pub fn scroll_x_max(&self) -> Option<f64>
pub fn scroll_y(&self) -> Option<f64>
pub fn scroll_y_min(&self) -> Option<f64>
pub fn scroll_y_max(&self) -> Option<f64>
pub(crate) fn fetch_inherited_property<T>( &self, getter: fn(&'a NodeData) -> Option<T>, ) -> Option<T>
pub fn is_text_input(&self) -> bool
pub fn is_multiline(&self) -> bool
pub fn orientation(&self) -> Option<Orientation>
pub fn is_clickable( &self, parent_filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> bool
pub fn is_selectable(&self) -> bool
pub fn is_multiselectable(&self) -> bool
pub fn size_of_set_from_container( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<usize>
pub fn size_of_set(&self) -> Option<usize>
pub fn position_in_set(&self) -> Option<usize>
pub fn supports_toggle(&self) -> bool
pub fn supports_expand_collapse(&self) -> bool
pub fn is_invocable( &self, parent_filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> bool
pub fn supports_action( &self, action: Action, parent_filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> bool
pub fn supports_increment( &self, parent_filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> bool
pub fn supports_decrement( &self, parent_filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> 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 label_comes_from_value(&self) -> bool
pub fn label(&self) -> Option<String>
fn write_label_direct<W: Write>(&self, writer: W) -> Result<bool, Error>
pub fn write_label<W: Write>(&self, writer: W) -> Result<bool, Error>
pub fn description(&self) -> Option<String>
fn is_empty_text_input(&self) -> bool
pub fn placeholder(&self) -> Option<&str>
pub fn value(&self) -> Option<String>
pub fn write_value<W: Write>(&self, writer: W) -> Result<bool, Error>
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 is_required(&self) -> bool
pub fn live(&self) -> Live
pub fn is_selected(&self) -> Option<bool>
pub fn is_item_like(&self) -> bool
pub fn is_container_with_selectable_children(&self) -> bool
pub fn controls( &self, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
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>
pub(crate) fn first_filtered_child( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
pub(crate) fn last_filtered_child( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
pub fn selection_container( &self, filter: &impl Fn(&Node<'_>) -> FilterResult, ) -> Option<Node<'a>>
pub fn items( &self, filter: impl Fn(&Node<'_>) -> FilterResult + 'a, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
Source§impl Node<'_>
impl Node<'_>
pub fn text_direction(&self) -> Option<TextDirection>
pub fn font_family(&self) -> Option<&str>
pub fn language(&self) -> Option<&str>
pub fn font_size(&self) -> Option<f64>
pub fn font_weight(&self) -> Option<f64>
pub fn background_color(&self) -> Option<u32>
pub fn foreground_color(&self) -> Option<u32>
pub fn overline(&self) -> Option<TextDecoration>
pub fn strikethrough(&self) -> Option<TextDecoration>
pub fn underline(&self) -> Option<TextDecoration>
pub fn text_align(&self) -> Option<TextAlign>
pub fn vertical_offset(&self) -> Option<VerticalOffset>
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub(crate) fn text_runs( &self, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
fn following_text_runs( &self, root_node: &Node<'_>, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
fn preceding_text_runs( &self, root_node: &Node<'_>, ) -> impl DoubleEndedIterator<Item = Node<'a>> + FusedIterator<Item = Node<'a>> + 'a
pub fn supports_text_ranges(&self) -> bool
fn document_start(&self) -> InnerPosition<'a>
fn document_end(&self) -> InnerPosition<'a>
pub fn document_range(&self) -> Range<'_>
pub fn has_text_selection(&self) -> bool
pub fn text_selection(&self) -> Option<Range<'_>>
pub fn text_selection_anchor(&self) -> Option<Position<'_>>
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