pub trait ToAst {
type Output;
// Required method
fn to_ast<I>(self, resolver: &I) -> Option<Self::Output>
where I: Resolver<TokenKey> + ?Sized;
}Expand description
Converts a concrete syntax tree (CST) node to its corresponding abstract syntax tree (AST) representation.
Required Associated Types§
Required Methods§
Sourcefn to_ast<I>(self, resolver: &I) -> Option<Self::Output>
fn to_ast<I>(self, resolver: &I) -> Option<Self::Output>
Attempts to convert this CST node to its corresponding AST representation.
Returns Some(ast_node) if the conversion is successful, or None if the
CST node cannot be represented in the AST (e.g., due to syntax errors or
unsupported constructs).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".