Struct fuzzcheck::sensors_and_pools::AndPool
source · [−]pub struct AndPool<P1, P2, ObservationsMarker> where
P1: Pool,
P2: Pool, {
pub p1: P1,
pub p2: P2,
pub p1_weight: f64,
pub p2_weight: f64,
/* private fields */
}
Expand description
A pool that combines two pools
A convenient way to create an AndPool
is to use p1.and(p2, ..)
, but you
are free to use AndPool::new
as well.
If the two pools act on the same observations , then the ObservationsMarker
generic type
parameter should be SameObservations
. However, if they act on different observations,
then this type parameter should be DifferentObservations
. This will influence what
observations the AndPool
is compatible with.
If both P1
and P2
are CompatibleWithObservations<O>
, then
AndPool<P1, P2, SameObservations>
will be CompatibleWithObservations<O>
as well.
If P1
is CompatibleWithObservations<O1>
and P2
is CompatibleWithObservations<O2>
, then
AndPool<P1, P2, DifferentObservations>
will be CompatibleWithObservations<(O1, O2)>
.
When the AndPool
is asked to provide a test case, it will
choose between p1
and p2
randomly based on their weights, given by self.p1_weight
and self.p2_weight
,
and based on how recently p1
or p2
made some progress. Pools that make progress will be prefered
over pools that do not.
Fields
p1: P1
p2: P2
p1_weight: f64
p2_weight: f64
Implementations
Trait Implementations
sourceimpl<O1, O2, P1, P2> CompatibleWithObservations<(O1, O2)> for AndPool<P1, P2, DifferentObservations> where
P1: Pool,
P2: Pool,
P1: CompatibleWithObservations<O1>,
P2: CompatibleWithObservations<O2>,
impl<O1, O2, P1, P2> CompatibleWithObservations<(O1, O2)> for AndPool<P1, P2, DifferentObservations> where
P1: Pool,
P2: Pool,
P1: CompatibleWithObservations<O1>,
P2: CompatibleWithObservations<O2>,
sourceimpl<P1, P2, O> CompatibleWithObservations<O> for AndPool<P1, P2, SameObservations> where
P1: CompatibleWithObservations<O>,
P2: CompatibleWithObservations<O>,
impl<P1, P2, O> CompatibleWithObservations<O> for AndPool<P1, P2, SameObservations> where
P1: CompatibleWithObservations<O>,
P2: CompatibleWithObservations<O>,
sourceimpl<P1, P2, ObservationsMarker> Pool for AndPool<P1, P2, ObservationsMarker> where
P1: Pool,
P2: Pool,
impl<P1, P2, ObservationsMarker> Pool for AndPool<P1, P2, ObservationsMarker> where
P1: Pool,
P2: Pool,
type Stats = AndPoolStats<<P1 as Pool>::Stats, <P2 as Pool>::Stats>
type Stats = AndPoolStats<<P1 as Pool>::Stats, <P2 as Pool>::Stats>
Statistics about the pool to be printed to the terminal as the fuzzer is running and saved to a .csv file after the run Read more
sourcefn get_random_index(&mut self) -> Option<PoolStorageIndex>
fn get_random_index(&mut self) -> Option<PoolStorageIndex>
Get the index of a random test case. Read more
sourceimpl<P1, P2, ObservationsMarker> SaveToStatsFolder for AndPool<P1, P2, ObservationsMarker> where
P1: Pool,
P2: Pool,
impl<P1, P2, ObservationsMarker> SaveToStatsFolder for AndPool<P1, P2, ObservationsMarker> where
P1: Pool,
P2: Pool,
Auto Trait Implementations
impl<P1, P2, ObservationsMarker> !RefUnwindSafe for AndPool<P1, P2, ObservationsMarker>
impl<P1, P2, ObservationsMarker> Send for AndPool<P1, P2, ObservationsMarker> where
ObservationsMarker: Send,
P1: Send,
P2: Send,
impl<P1, P2, ObservationsMarker> !Sync for AndPool<P1, P2, ObservationsMarker>
impl<P1, P2, ObservationsMarker> Unpin for AndPool<P1, P2, ObservationsMarker> where
ObservationsMarker: Unpin,
P1: Unpin,
P2: Unpin,
impl<P1, P2, ObservationsMarker> UnwindSafe for AndPool<P1, P2, ObservationsMarker> where
ObservationsMarker: UnwindSafe,
P1: UnwindSafe,
P2: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more