pub trait Transformer {
// Required method
fn transform(
&self,
doc: &mut Document,
meta: &SourceMeta,
diag_engine: &mut DiagnosticEngine<Code>,
);
// Provided method
fn name(&self) -> &str { ... }
}Expand description
One AST-to-AST pass. transform takes &self so a transformer is cheap
to share across threads or reuse across files.
Required Methods§
Sourcefn transform(
&self,
doc: &mut Document,
meta: &SourceMeta,
diag_engine: &mut DiagnosticEngine<Code>,
)
fn transform( &self, doc: &mut Document, meta: &SourceMeta, diag_engine: &mut DiagnosticEngine<Code>, )
Mutate doc in place. May be a no-op when preconditions (config,
environment, feature flags) aren’t met.