Ast
struct · ferroui-designer-core · v0.5.0
struct Ast
Lossless syntax index. Serialization is the owning document's source string, rather than a pretty printer that would erase syntax trivia.
Members
rootrootsnodenodeselementsnodes_in_source_ordernodes_with_name_scopessubtreeelement_childrenfind_namename_scopenode_atelement_atis_descendant_ofnamespaces
root
fn root(self: &Self) -> NodeId
roots
fn roots(self: &Self) -> &[NodeId]
node
fn node(self: &Self, id: NodeId) -> Option<&Node>
nodes
fn nodes(self: &Self) -> impl Iterator<Item = &Node>
elements
fn elements(self: &Self) -> impl Iterator<Item = &Node>
nodes_in_source_order
fn nodes_in_source_order(self: &Self) -> impl Iterator<Item = &Node>
Visit syntax nodes in lexical order, independently of stable node IDs. Moving an element changes this order without changing its identity.
nodes_with_name_scopes
fn nodes_with_name_scopes(self: &Self) -> impl Iterator<Item = (&Node, NodeId)>
Visit syntax nodes and their containing XAML name scopes in source order. Scope propagation visits each node once instead of walking its ancestors for every name or reference in a language-service indexing pass.
subtree
fn subtree(self: &Self, root: NodeId) -> impl Iterator<Item = &Node>
Visit a node and all its syntax descendants in source order. An unknown root produces an empty iterator; unrelated document nodes are not visited.
element_children
fn element_children(self: &Self, parent: NodeId) -> Vec<NodeId>
find_name
fn find_name(self: &Self, name: &str) -> Option<NodeId>
name_scope
fn name_scope(self: &Self, node: NodeId) -> NodeId
The containing XAML name scope. Template contents have their own scope; a template's declaration belongs to its parent's scope. Unknown nodes and top-level declarations use the document root.
node_at
fn node_at(self: &Self, byte_offset: usize) -> Option<NodeId>
element_at
fn element_at(self: &Self, byte_offset: usize) -> Option<NodeId>
is_descendant_of
fn is_descendant_of(self: &Self, node: NodeId, ancestor: NodeId) -> bool
namespaces
fn namespaces(self: &Self, node: NodeId) -> BTreeMap<String, String>
Namespaces in scope at an element, nearest declaration wins.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedDeserializeOwnedDeserialize<'de>CloneDebugStructuralPartialEqPartialEqEqSerialize
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.