pub trait Reconstruct<N: ExternalCstNode>: Sized {
// Required methods
fn matches(node: &N) -> bool;
fn reconstruct(node: N) -> Result<Self, ReconstructError>;
}Expand description
Reconstructs one typed value from a parser backend’s untyped CST node.
Required Methods§
Sourcefn reconstruct(node: N) -> Result<Self, ReconstructError>
fn reconstruct(node: N) -> Result<Self, ReconstructError>
Converts a matching external node into typed syntax.
§Errors
Returns a ReconstructError when the node or its children do not
match the requested typed syntax.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".