pub trait Mutation<Value, M>: Sized{
type RandomStep: Clone;
type Step: Clone;
type Concrete<'a>
where M: 'a,
Value: 'a;
type Revert: RevertMutation<Value, M>;
// Required methods
fn default_random_step(
&self,
mutator: &M,
value: &Value,
) -> Option<Self::RandomStep>;
fn random<'a>(
mutator: &M,
value: &Value,
cache: &M::Cache,
random_step: &Self::RandomStep,
max_cplx: f64,
) -> Self::Concrete<'a>;
fn default_step(
&self,
mutator: &M,
value: &Value,
cache: &M::Cache,
) -> Option<Self::Step>;
fn from_step<'a>(
mutator: &M,
value: &Value,
cache: &M::Cache,
step: &'a mut Self::Step,
subvalue_provider: &dyn SubValueProvider,
max_cplx: f64,
) -> Option<Self::Concrete<'a>>;
fn apply<'a>(
mutation: Self::Concrete<'a>,
mutator: &M,
value: &mut Value,
cache: &mut M::Cache,
subvalue_provider: &dyn SubValueProvider,
max_cplx: f64,
) -> (Self::Revert, f64);
}Required Associated Types§
type RandomStep: Clone
type Step: Clone
type Concrete<'a> where M: 'a, Value: 'a
type Revert: RevertMutation<Value, M>
Required Methods§
fn default_random_step( &self, mutator: &M, value: &Value, ) -> Option<Self::RandomStep>
fn random<'a>( mutator: &M, value: &Value, cache: &M::Cache, random_step: &Self::RandomStep, max_cplx: f64, ) -> Self::Concrete<'a>
fn default_step( &self, mutator: &M, value: &Value, cache: &M::Cache, ) -> Option<Self::Step>
fn from_step<'a>( mutator: &M, value: &Value, cache: &M::Cache, step: &'a mut Self::Step, subvalue_provider: &dyn SubValueProvider, max_cplx: f64, ) -> Option<Self::Concrete<'a>>
fn apply<'a>( mutation: Self::Concrete<'a>, mutator: &M, value: &mut Value, cache: &mut M::Cache, subvalue_provider: &dyn SubValueProvider, max_cplx: f64, ) -> (Self::Revert, f64)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.