Skip to main content

SemanticTree

Struct SemanticTree 

Source
pub struct SemanticTree { /* private fields */ }
Expand description

The semantic tree of every window.

Implementations§

Source§

impl SemanticTree

Source

pub fn hit_test(&self, window: WindowId, point: Point) -> Option<NodeId>

The node drawn on top at point: the deepest node whose visible bounds contain it, from the highest layer down. Ignored generics count, because they still paint.

Source§

impl SemanticTree

Source

pub fn get(&self, id: NodeId) -> Option<&Node>

The node with this id, or None for an id from another tree that is out of range.

Source

pub fn roots(&self) -> &[NodeId]

One Window node per window.

Source

pub fn warnings(&self) -> &[TreeWarning]

Warnings from building the tree.

Source

pub fn iter(&self) -> impl Iterator<Item = &Node>

Every node, in operation order.

Source

pub fn len(&self) -> usize

The number of nodes, ignored ones included.

Source

pub fn is_empty(&self) -> bool

Whether the tree has no nodes.

Source

pub fn descendants(&self, id: NodeId) -> impl Iterator<Item = NodeId> + '_

Every node below id in depth-first order, following owns into owned subtrees. Each node appears once.

Source

pub fn descendants_unseen<'a>( &'a self, id: NodeId, seen: &'a mut [bool], ) -> impl Iterator<Item = NodeId> + 'a

Like descendants, with seen, one flag per node, shared between calls: a node already marked is neither yielded nor walked into, since its own descendants were walked when it was marked. Walking from several starts this way visits each node once and allocates no flags of its own.

Source

pub fn ancestors(&self, id: NodeId) -> impl Iterator<Item = NodeId> + '_

The parents of id, nearest first.

Source

pub fn text_content(&self, id: NodeId) -> &str

The node’s own text joined with its non-hidden descendants’ text in tree order.

Source

pub fn find_path(&self, path: &NodePath) -> Option<NodeId>

The node at a path from this or another snapshot.

Source

pub fn node_at(&self, path: &NodePath) -> Option<&Node>

The node at a path, as a node.

Source

pub fn by_raw(&self, raw: &[u32]) -> Option<NodeId>

The node recorded at a raw index path, or the deepest node whose raw path is a prefix of it, which is the node that absorbed or merged that raw call.

Source

pub fn window(&self, id: WindowId) -> Option<NodeId>

The window’s root node.

Source

pub fn renumber_widget_ids(&mut self, renumber: impl FnMut(usize) -> usize)

Rewrites the number of every WidgetId::Unique through renumber. iced numbers unique ids from one process-wide counter, so a trace renumbers them to compare across runs.

Trait Implementations§

Source§

impl Clone for SemanticTree

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for SemanticTree

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SemanticTree

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SemanticTree

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SemanticTree

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SemanticTree

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SemanticTree

Auto Trait Implementations§

§

impl Forget for SemanticTree

§

impl Freeze for SemanticTree

§

impl Move for SemanticTree

§

impl RefUnwindSafe for SemanticTree

§

impl Send for SemanticTree
where RawVecInner: Send, NodeRef<Owned, StateName, StateSource, LeafOrInternal>: Send, BoxRaw<(StateName, StateSource)>: Send, &'static str: Send, String: Send, NodeRef<Owned, String, String, LeafOrInternal>: Send, BoxRaw<(String, String)>: Send,

§

impl Sync for SemanticTree
where RawVecInner: Sync, NodeRef<Owned, StateName, StateSource, LeafOrInternal>: Sync, BoxRaw<(StateName, StateSource)>: Sync, String: Sync, NodeRef<Owned, String, String, LeafOrInternal>: Sync, BoxRaw<(String, String)>: Sync,

§

impl Unpin for SemanticTree
where *const u8 is !null: Unpin, *const LeafNode<StateName, StateSource> is !null: Unpin, Box<(StateName, StateSource)>: Unpin, &'static str: Unpin, String: Unpin, *const LeafNode<String, String> is !null: Unpin, Box<(String, String)>: Unpin,

§

impl UnsafeUnpin for SemanticTree

§

impl UnwindSafe for SemanticTree

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

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

fn try_from(value: U) -> Result<T, !>

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.