pub struct ResultMutator<T, E, M0_0, M1_0>{ /* private fields */ }Implementations§
Trait Implementations§
Source§impl<T, E, M0_0, M1_0> Mutator<Result<T, E>> for ResultMutator<T, E, M0_0, M1_0>
impl<T, E, M0_0, M1_0> Mutator<Result<T, E>> for ResultMutator<T, E, M0_0, M1_0>
Source§type Cache: Clone
type Cache: Clone
Accompanies each value to help compute its complexity and mutate it efficiently.
Source§type MutationStep: Clone
type MutationStep: Clone
Contains information about what mutations have already been tried.
Source§type ArbitraryStep: Clone
type ArbitraryStep: Clone
Contains information about what arbitrary values have already been generated.
Source§type UnmutateToken
type UnmutateToken
Describes how to reverse a mutation
Source§fn initialize(&self)
fn initialize(&self)
Must be called after creating a mutator, to initialise its internal state.
Source§fn default_arbitrary_step(&self) -> Self::ArbitraryStep
fn default_arbitrary_step(&self) -> Self::ArbitraryStep
The first
ArbitraryStep value to be passed to ordered_arbitrarySource§fn is_valid(&self, value: &Value) -> bool
fn is_valid(&self, value: &Value) -> bool
Quickly verifies that the value conforms to the mutator’s expectations
Source§fn validate_value(&self, value: &Value) -> Option<Self::Cache>
fn validate_value(&self, value: &Value) -> Option<Self::Cache>
Verifies that the value conforms to the mutator’s expectations and, if it does,
returns the
Cache associated with that value.Source§fn default_mutation_step(
&self,
value: &Value,
cache: &Self::Cache,
) -> Self::MutationStep
fn default_mutation_step( &self, value: &Value, cache: &Self::Cache, ) -> Self::MutationStep
Returns the first
MutationStep associated with the value
and cache.Source§fn global_search_space_complexity(&self) -> f64
fn global_search_space_complexity(&self) -> f64
The log2 of the number of values that can be produced by this mutator,
or an approximation of this number (e.g. the number of bits that are
needed to identify each possible value). Read more
Source§fn max_complexity(&self) -> f64
fn max_complexity(&self) -> f64
The maximum complexity that a value can possibly have.
Source§fn min_complexity(&self) -> f64
fn min_complexity(&self) -> f64
The minimum complexity that a value can possibly have.
Source§fn complexity(&self, value: &Value, cache: &Self::Cache) -> f64
fn complexity(&self, value: &Value, cache: &Self::Cache) -> f64
Computes the complexity of the value. Read more
Source§fn ordered_arbitrary(
&self,
step: &mut Self::ArbitraryStep,
max_cplx: f64,
) -> Option<(Value, f64)>
fn ordered_arbitrary( &self, step: &mut Self::ArbitraryStep, max_cplx: f64, ) -> Option<(Value, f64)>
Generates an entirely new value based on the given
ArbitraryStep. Read moreSource§fn random_arbitrary(&self, max_cplx: f64) -> (Value, f64)
fn random_arbitrary(&self, max_cplx: f64) -> (Value, f64)
Generates an entirely new value. Read more
Source§fn ordered_mutate(
&self,
value: &mut Value,
cache: &mut Self::Cache,
step: &mut Self::MutationStep,
subvalue_provider: &dyn SubValueProvider,
max_cplx: f64,
) -> Option<(Self::UnmutateToken, f64)>
fn ordered_mutate( &self, value: &mut Value, cache: &mut Self::Cache, step: &mut Self::MutationStep, subvalue_provider: &dyn SubValueProvider, max_cplx: f64, ) -> Option<(Self::UnmutateToken, f64)>
Mutates a value (and optionally its cache) based on the given
MutationStep. Read moreSource§fn random_mutate(
&self,
value: &mut Value,
cache: &mut Self::Cache,
max_cplx: f64,
) -> (Self::UnmutateToken, f64)
fn random_mutate( &self, value: &mut Value, cache: &mut Self::Cache, max_cplx: f64, ) -> (Self::UnmutateToken, f64)
Mutates a value (and optionally its cache). Read more
Source§fn unmutate(
&self,
value: &mut Value,
cache: &mut Self::Cache,
t: Self::UnmutateToken,
)
fn unmutate( &self, value: &mut Value, cache: &mut Self::Cache, t: Self::UnmutateToken, )
Undoes a mutation performed on the given value and cache, described by
the given
UnmutateToken.Auto Trait Implementations§
impl<T, E, M0_0, M1_0> !Freeze for ResultMutator<T, E, M0_0, M1_0>
impl<T, E, M0_0, M1_0> !RefUnwindSafe for ResultMutator<T, E, M0_0, M1_0>
impl<T, E, M0_0, M1_0> Send for ResultMutator<T, E, M0_0, M1_0>
impl<T, E, M0_0, M1_0> !Sync for ResultMutator<T, E, M0_0, M1_0>
impl<T, E, M0_0, M1_0> Unpin for ResultMutator<T, E, M0_0, M1_0>
impl<T, E, M0_0, M1_0> UnwindSafe for ResultMutator<T, E, M0_0, M1_0>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, M> MutatorExt<T> for M
impl<T, M> MutatorExt<T> for M
Source§fn filter<F>(self, filter: F) -> FilterMutator<Self, F>
fn filter<F>(self, filter: F) -> FilterMutator<Self, F>
Create a mutator which wraps
self but only produces values
for which the given closure returns true