pub trait FuzzTarget {
type Input: Arbitrary<'static>;
// Required method
fn fuzz_once(&mut self, input: Self::Input) -> FuzzResult;
}Expand description
Trait for implementing fuzz targets
Implementors define an Input type that can be generated arbitrarily
and a fuzz_once method that tests the code with that input.
Required Associated Types§
Required Methods§
Sourcefn fuzz_once(&mut self, input: Self::Input) -> FuzzResult
fn fuzz_once(&mut self, input: Self::Input) -> FuzzResult
Execute one fuzz iteration with the given input
This method should:
- Test the target code with the input
- Return
FuzzResult::Okif processing succeeds - Return
FuzzResult::Invalidif input is malformed (expected) - Return
FuzzResult::Bugif an unexpected error occurs
The method should catch panics and convert them to FuzzResult::Bug.