Trait fuzzcheck::Sensor [−][src]
pub trait Sensor: SaveToStatsFolder {
type ObservationHandler;
fn start_recording(&mut self);
fn stop_recording(&mut self);
fn iterate_over_observations(&mut self, handler: Self::ObservationHandler);
}Expand description
A Sensor records information when running the test function, which the fuzzer can use to determine the importance of a test case.
For example, the sensor can record the code coverage triggered by the test case, store the source location of a panic, measure the number of allocations made, etc. The observations made by a sensor are then assessed by a Pool, which must be explicitly compatible with the sensor.
Associated Types
A type that is used to retrieve the observations made by the sensor.
For example, if the sensor stores only one value of type u8, the
observation handler can be &'a mut u8. But if the observations are retrieved one-by-one, the observation handler may be &'a mut dyn FnMut(T).
Required methods
fn start_recording(&mut self)
fn start_recording(&mut self)
Signal to the sensor that it should prepare to record observations
fn stop_recording(&mut self)
fn stop_recording(&mut self)
Signal to the sensor that it should stop recording observations
fn iterate_over_observations(&mut self, handler: Self::ObservationHandler)
fn iterate_over_observations(&mut self, handler: Self::ObservationHandler)
Access the sensor’s observations through the handler