pub trait MutationHandler: Send + Sync {
// Required methods
fn before_mutation(&self, trace: &Trace, generation: usize) -> bool;
fn after_mutation(
&self,
original: &Trace,
mutated: &Trace,
record: &MutationRecord,
);
// Provided method
fn modify_sites(
&self,
sites: HashSet<Address>,
_trace: &Trace,
) -> HashSet<Address> { ... }
}Expand description
Effect handler trait for mutation operations
Required Methods§
Sourcefn before_mutation(&self, trace: &Trace, generation: usize) -> bool
fn before_mutation(&self, trace: &Trace, generation: usize) -> bool
Called before mutation is applied Returns true if mutation should proceed, false to skip
Sourcefn after_mutation(
&self,
original: &Trace,
mutated: &Trace,
record: &MutationRecord,
)
fn after_mutation( &self, original: &Trace, mutated: &Trace, record: &MutationRecord, )
Called after mutation is applied
Provided Methods§
Sourcefn modify_sites(
&self,
sites: HashSet<Address>,
_trace: &Trace,
) -> HashSet<Address>
fn modify_sites( &self, sites: HashSet<Address>, _trace: &Trace, ) -> HashSet<Address>
Optionally modify the mutation sites before mutation occurs