FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    root

    fn root(self: &Self) -> NodeId
    

    Source

    roots

    fn roots(self: &Self) -> &[NodeId]
    

    Source

    node

    fn node(self: &Self, id: NodeId) -> Option<&Node>
    

    Source

    nodes

    fn nodes(self: &Self) -> impl Iterator<Item = &Node>
    

    Source

    elements

    fn elements(self: &Self) -> impl Iterator<Item = &Node>
    

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    element_children

    fn element_children(self: &Self, parent: NodeId) -> Vec<NodeId>
    

    Source

    find_name

    fn find_name(self: &Self, name: &str) -> Option<NodeId>
    

    Source

    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.

    Source

    node_at

    fn node_at(self: &Self, byte_offset: usize) -> Option<NodeId>
    

    Source

    element_at

    fn element_at(self: &Self, byte_offset: usize) -> Option<NodeId>
    

    Source

    is_descendant_of

    fn is_descendant_of(self: &Self, node: NodeId, ancestor: NodeId) -> bool
    

    Source

    namespaces

    fn namespaces(self: &Self, node: NodeId) -> BTreeMap<String, String>
    

    Namespaces in scope at an element, nearest declaration wins.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • DeserializeOwned
    • Deserialize<'de>
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Serialize

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.