Trait Sensor

Source
pub trait Sensor: SaveToStatsFolder + 'static {
    type Observations;

    // Required methods
    fn start_recording(&mut self);
    fn stop_recording(&mut self);
    fn get_observations(&mut self) -> Self::Observations;
}
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’s observations.

Required Associated Types§

Required Methods§

Source

fn start_recording(&mut self)

Signal to the sensor that it should prepare to record observations

Source

fn stop_recording(&mut self)

Signal to the sensor that it should stop recording observations

Source

fn get_observations(&mut self) -> Self::Observations

Access the sensor’s observations

Implementors§

Source§

impl Sensor for AllocationSensor

Source§

impl Sensor for CodeCoverageSensor

Source§

impl Sensor for NoopSensor

Source§

impl Sensor for TestFailureSensor

Source§

impl<S1, S2> Sensor for AndSensor<S1, S2>
where S1: Sensor, S2: Sensor,

Source§

impl<S, ToObservations, F> Sensor for MapSensor<S, ToObservations, F>
where S: Sensor, F: Fn(S::Observations) -> ToObservations, Self: 'static,

Source§

type Observations = ToObservations

Source§

impl<T> Sensor for StaticValueSensor<T>
where T: Clone + 'static,