pub trait MutationHook: 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
Operation hook for the trace-based mutation operator.
NOTE: this is a plain before/after callback, not a [fugue::Handler].
It cannot intercept a Fugue model; it only observes / gates the
super::trace_operators mutation operator.
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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".