pub struct UniqueMutator<T, TH, Focus, M> where
    T: Clone + 'static,
    TH: Hash,
    M: Mutator<T>,
    Focus: Fn(&T) -> &TH, 
{ /* private fields */ }
Expand description

Experimental mutator which tries to prevent duplicate values to be tested, using a bloom filter

Important: this mutator cannot be used as a submutator.

Implementations

Create a new UniqueMutator by wrapping another mutator.

The Focus closure points to the hashable part of the value. This should almost always be the identity function. But there is an exception when we don’t care about some part of the generated value. For example, a grammar-based mutator implements Mutator<(AST, String)>, but it is very likely that the test function will only operate on the String and not the AST. In that case, the Focus closure is |x| &x.1.

Trait Implementations

Accompanies each value to help compute its complexity and mutate it efficiently.

Contains information about what mutations have already been tried.

Contains information about what arbitrary values have already been generated.

Describes how to reverse a mutation

The first ArbitraryStep value to be passed to ordered_arbitrary

Quickly verifies that the value conforms to the mutator’s expectations

Verifies that the value conforms to the mutator’s expectations and, if it does, returns the Cache associated with that value. Read more

Returns the first MutationStep associated with the value and cache. Read more

The maximum complexity that a value can possibly have.

The minimum complexity that a value can possibly have.

Computes the complexity of the value. Read more

Generates an entirely new value based on the given ArbitraryStep. Read more

Generates an entirely new value. Read more

Mutates a value (and optionally its cache) based on the given MutationStep. Read more

Mutates a value (and optionally its cache). Read more

Undoes a mutation performed on the given value and cache, described by the given UnmutateToken. Read more

Call the given closure on all subvalues and their complexities.

The log2 of the number of values that can be produced by this mutator, or an approximation of this number (e.g. the number of bits that are needed to identify each possible value). Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Create a mutator which wraps self but only produces values for which the given closure returns true Read more

Create a mutator which wraps self and transforms the values generated by self using the map closure. The second closure, parse, should apply the opposite transformation. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.