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§
Sourcefn nodes(&self) -> Vec<ProjectedNode>
fn nodes(&self) -> Vec<ProjectedNode>
Return all nodes in DFS traversal order with display information.
Sourcefn children(&self, node: NodeId) -> Vec<SlotEntry>
fn children(&self, node: NodeId) -> Vec<SlotEntry>
Get named slot entries (children) for a specific node.
Sourcefn inspect(&self, node: NodeId) -> Option<NodeDetail>
fn inspect(&self, node: NodeId) -> Option<NodeDetail>
Get detailed information about a node including constraints.
Sourcefn hole_candidates(&self, hole: NodeId) -> Vec<CandidateKind>
fn hole_candidates(&self, hole: NodeId) -> Vec<CandidateKind>
Get candidate types that can fill a hole node.
Sourcefn available_actions(&self) -> Vec<AvailableAction>
fn available_actions(&self) -> Vec<AvailableAction>
Get all available actions that can be performed on the AST.
Sourcefn why_not_editable(&self, node: NodeId) -> Option<NotEditableReason>
fn why_not_editable(&self, node: NodeId) -> Option<NotEditableReason>
Check if a node cannot be edited and return the reason.
Sourcefn completeness(&self) -> CompletenessSummary
fn completeness(&self) -> CompletenessSummary
Get a summary of AST completeness status.