Skip to main content

MutationHandler

Trait MutationHandler 

Source
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§

Source

fn before_mutation(&self, trace: &Trace, generation: usize) -> bool

Called before mutation is applied Returns true if mutation should proceed, false to skip

Source

fn after_mutation( &self, original: &Trace, mutated: &Trace, record: &MutationRecord, )

Called after mutation is applied

Provided Methods§

Source

fn modify_sites( &self, sites: HashSet<Address>, _trace: &Trace, ) -> HashSet<Address>

Optionally modify the mutation sites before mutation occurs

Implementors§