pub trait Migrate<N: ExternalCstNode>: Sized {
// Required methods
fn matches(node: &N) -> bool;
fn migrate(node: N) -> Result<Self, MigrateError>;
}Expand description
Migrates one typed value from a parser backend’s untyped CST node.
Required Methods§
Sourcefn migrate(node: N) -> Result<Self, MigrateError>
fn migrate(node: N) -> Result<Self, MigrateError>
Converts a matching external node into typed syntax.
§Errors
Returns a MigrateError 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".