pub struct FuzzerBuilder1<T, F> where
    T: ?Sized,
    F: Fn(&T) -> bool + 'static, 
{ /* private fields */ }
Expand description

A fuzz-test builder that knows the function to fuzz-test. It is created by calling fuzz_test(..).

Use self.mutator(..) to specify the mutator and obtain a FuzzerBuilder2. If the function argument’s type implements DefaultMutator, you can also use self.default_mutator().

Alternatively, use self.default_options() to use the default mutator, serializer, sensor, pool, and arguments, and obtain a FuzzerBuilder5. This method is only available if the argument of the test function implements DefaultMutator and is serializable with serde.

Implementations

Available on crate feature serde_json_serializer only.

Use the default mutator, serializer, sensor, pool, and arguments.

Use the DefaultMutator trait to specify the mutator that produces input values for the tested function.

Specify the mutator that produces input values for the tested function.

For example, if the test function is:

fn foo(xs: &[u8]) {
    // ..
}

Then the given mutator should produces values that can be borrowed as [u8]. We can write:

use fuzzcheck::DefaultMutator;
use fuzzcheck::mutators::vector::VecMutator;
fn foo(xs: &[u8]) {
    // ..
}
fn fuzz_test() {
    fuzzcheck::fuzz_test(foo)
        .mutator(VecMutator::new(u8::default_mutator(), 2 ..= 10, true))
        // ..
}

Alternatively, if you would like to use the argument type’s default mutator, you can use .default_mutator(), as follows:

use fuzzcheck::DefaultMutator;
fn foo(xs: &[u8]) {
    // ..
}
fn fuzz_test() {
    fuzzcheck::fuzz_test(foo)
        .default_mutator()
        // ..
}

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.

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.