Trait fuzzcheck::SensorAndPool
source · [−]pub trait SensorAndPool: SaveToStatsFolder {
fn stats(&self) -> Box<dyn Stats>;
fn start_recording(&mut self);
fn stop_recording(&mut self);
fn process(
&mut self,
input_id: PoolStorageIndex,
cplx: f64
) -> Vec<CorpusDelta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
;
fn get_random_index(&mut self) -> Option<PoolStorageIndex>;
}
Expand description
An object safe trait that combines the methods of the Sensor
, Pool
, and CompatibleWithObservations
traits.
While it’s often useful to work with the Sensor
and Pool
traits separately, the
fuzzer doesn’t actually need to know about the sensor and pool individually. By having
this SensorAndPool
trait, we can give the fuzzer a Box<dyn SensorAndPool>
and get rid of
two generic type parameters: S: Sensor
and P: Pool + CompatibleWithObservations<S::Observations>
.
This is better for compile times and simplifies the implementation of the fuzzer. Users of
fuzzcheck
should feel free to ignore this trait, as it is arguably more an implementation detail
than a fundamental building block of the fuzzer.
Currently, there are two types implementing SensorAndPool
:
(S, P)
whereS: Sensor
andP: Pool + CompatibleWithObservations<S::Observations>
AndSensorAndPool
Required Methods
fn start_recording(&mut self)
fn stop_recording(&mut self)
fn process(&mut self, input_id: PoolStorageIndex, cplx: f64) -> Vec<CorpusDelta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn get_random_index(&mut self) -> Option<PoolStorageIndex>
Implementations on Foreign Types
sourceimpl<S, P> SensorAndPool for (S, P) where
S: Sensor,
P: CompatibleWithObservations<S::Observations>,
S: SaveToStatsFolder,
P: SaveToStatsFolder,
impl<S, P> SensorAndPool for (S, P) where
S: Sensor,
P: CompatibleWithObservations<S::Observations>,
S: SaveToStatsFolder,
P: SaveToStatsFolder,
fn stats(&self) -> Box<dyn Stats>
fn start_recording(&mut self)
fn stop_recording(&mut self)
fn process(
&mut self,
input_id: PoolStorageIndex,
complexity: f64
) -> Vec<CorpusDelta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,