pub struct ASTMutationEngine;Expand description
AST-centric mutation execution engine
Executes mutations against registries only, with no file I/O.
§Invariants
- NO file I/O during execution
- NO PureFile access (only ASTRegistry)
- ALL state changes via Registry APIs
§Usage
ⓘ
let mutation = AddFieldMutation::new("MyStruct", "new_field", "i32");
let result = ASTMutationEngine::execute_ast_reg(&mutation, &mut ctx);
for event in &result.events {
println!("{}", event);
}Implementations§
Source§impl ASTMutationEngine
impl ASTMutationEngine
Sourcepub fn execute_ast_reg<M: ASTRegApply>(
mutation: &M,
ctx: &mut AnalysisContext,
) -> ExecutionResult
pub fn execute_ast_reg<M: ASTRegApply>( mutation: &M, ctx: &mut AnalysisContext, ) -> ExecutionResult
Execute a mutation that implements ASTRegApply
This is the primary execution path for registry-based mutations.
Uses ASTRegApply::apply_to_registry for actual execution.
§Type Parameters
M- Mutation type that implements bothMutationandASTRegApply
§Example
ⓘ
use ryo_executor::ASTMutationEngine;
let mutation = AddFieldMutation::new("MyStruct", "field", "i32");
let result = ASTMutationEngine::execute_ast_reg(&mutation, &mut ctx);Sourcepub fn execute_ast_reg_batch<M: ASTRegApply>(
mutations: &[&M],
ctx: &mut AnalysisContext,
) -> ExecutionResult
pub fn execute_ast_reg_batch<M: ASTRegApply>( mutations: &[&M], ctx: &mut AnalysisContext, ) -> ExecutionResult
Execute multiple ASTRegApply mutations in sequence
Sourcepub fn execute_ast_reg_dyn(
mutation: &dyn ASTRegApply,
ctx: &mut AnalysisContext,
) -> ExecutionResult
pub fn execute_ast_reg_dyn( mutation: &dyn ASTRegApply, ctx: &mut AnalysisContext, ) -> ExecutionResult
Execute a boxed ASTRegApply mutation (dynamic dispatch)
This is the primary execution path for V2 conversion.
Accepts Box<dyn ASTRegApply> from MutationConverter::convert_v2().
§Example
ⓘ
let mutations = converter.convert_v2(&spec, &ctx)?;
for mutation in mutations {
let result = ASTMutationEngine::execute_ast_reg_dyn(mutation.as_ref(), &mut ctx);
}Sourcepub fn execute_ast_reg_batch_dyn(
mutations: Vec<Box<dyn ASTRegApply>>,
ctx: &mut AnalysisContext,
) -> ExecutionResult
pub fn execute_ast_reg_batch_dyn( mutations: Vec<Box<dyn ASTRegApply>>, ctx: &mut AnalysisContext, ) -> ExecutionResult
Execute multiple boxed ASTRegApply mutations in sequence (dynamic dispatch)
This is the batch execution path for V2 conversion.
Accepts Vec<Box<dyn ASTRegApply>> from MutationConverter::convert_v2().
§Example
ⓘ
let mutations = converter.convert_v2(&spec, &ctx)?;
let result = ASTMutationEngine::execute_ast_reg_batch_dyn(mutations, &mut ctx);Auto Trait Implementations§
impl Freeze for ASTMutationEngine
impl RefUnwindSafe for ASTMutationEngine
impl Send for ASTMutationEngine
impl Sync for ASTMutationEngine
impl Unpin for ASTMutationEngine
impl UnsafeUnpin for ASTMutationEngine
impl UnwindSafe for ASTMutationEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more