Skip to main content

WalkSource

Trait WalkSource 

Source
pub trait WalkSource {
    // Required methods
    fn listed(&self) -> &[TreeId];
    fn node_tree(&self, tree: TreeId) -> Option<&NodeTree<Flm>>;
    fn placement(&self, site: NodeAddr) -> Option<TreeId>;
}
Expand description

The trees a Walk visits: trees by identifier, the trees of the traversal list in order, and which node places which tree.

Walk defines document order and reads its trees through this trait, so that the same order applies to any set of trees that represents a document’s trees: DocContent is the source of the trees as parsed, and a run is the source of its frozen trees, what each tree became after the rewrites (StageCx::walk). The module documentation describes the order.

Required Methods§

Source

fn listed(&self) -> &[TreeId]

The trees of the traversal list, in the order the walk visits them. A tree that the walk reaches only through a node that places it is not in this list.

Source

fn node_tree(&self, tree: TreeId) -> Option<&NodeTree<Flm>>

The node tree of the tree tree, or None when the source holds no tree with that identifier; the walk then does not enter it.

Source

fn placement(&self, site: NodeAddr) -> Option<TreeId>

The tree that the node at site, a node of one of the source’s trees, places, or None when it places none.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl WalkSource for DocContent

The content of a document is the walk’s source for its trees as parsed: the arena gives the trees, the traversal list the trees listed, and the resolution map the placements.