pub trait Transform {
// Required methods
fn name(&self) -> &str;
fn transform(&self, root: &mut Root, source: &str);
}Expand description
A transform that operates on an RDX AST in place.
Implement this trait to create custom RDX plugins. Transforms receive a mutable reference to the full document root and the original source text.
§Example
use rdx_transform::{Transform, Root};
struct MyPlugin;
impl Transform for MyPlugin {
fn name(&self) -> &str { "my-plugin" }
fn transform(&self, root: &mut Root, _source: &str) {
// modify the AST
}
}