Skip to main content

ProjectionAPI

Trait ProjectionAPI 

Source
pub trait ProjectionAPI {
    // Required methods
    fn nodes(&self) -> Vec<ProjectedNode>;
    fn children(&self, node: NodeId) -> Vec<SlotEntry>;
    fn inspect(&self, node: NodeId) -> Option<NodeDetail>;
    fn hole_candidates(&self, hole: NodeId) -> Vec<CandidateKind>;
    fn available_actions(&self) -> Vec<AvailableAction>;
    fn why_not_editable(&self, node: NodeId) -> Option<NotEditableReason>;
    fn completeness(&self) -> CompletenessSummary;
}
Expand description

The main projection API for viewing AST structure and constraints.

This trait provides read-only views of the AST for UI consumption, transforming internal representations into display-ready formats.

Required Methods§

Source

fn nodes(&self) -> Vec<ProjectedNode>

Return all nodes in DFS traversal order with display information.

Source

fn children(&self, node: NodeId) -> Vec<SlotEntry>

Get named slot entries (children) for a specific node.

Source

fn inspect(&self, node: NodeId) -> Option<NodeDetail>

Get detailed information about a node including constraints.

Source

fn hole_candidates(&self, hole: NodeId) -> Vec<CandidateKind>

Get candidate types that can fill a hole node.

Source

fn available_actions(&self) -> Vec<AvailableAction>

Get all available actions that can be performed on the AST.

Source

fn why_not_editable(&self, node: NodeId) -> Option<NotEditableReason>

Check if a node cannot be edited and return the reason.

Source

fn completeness(&self) -> CompletenessSummary

Get a summary of AST completeness status.

Implementors§