Trait Mutation

Source
pub trait Mutation<Value, M>: Sized
where Value: Clone + 'static, M: Mutator<Value>,
{ 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§

Source

type RandomStep: Clone

Source

type Step: Clone

Source

type Concrete<'a> where M: 'a, Value: 'a

Source

type Revert: RevertMutation<Value, M>

Required Methods§

Source

fn default_random_step( &self, mutator: &M, value: &Value, ) -> Option<Self::RandomStep>

Source

fn random<'a>( mutator: &M, value: &Value, cache: &M::Cache, random_step: &Self::RandomStep, max_cplx: f64, ) -> Self::Concrete<'a>

Source

fn default_step( &self, mutator: &M, value: &Value, cache: &M::Cache, ) -> Option<Self::Step>

Source

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>>

Source

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.

Implementors§

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for Arbitrary
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for CopyElement
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for CrossoverInsertSlice
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for CrossoverReplaceElement
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for InsertElement
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for InsertManyElements
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for MutateElement
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for OnlyChooseLength
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for Remove
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for RemoveAndInsertElement
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for SwapElements
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<T, M> Mutation<Vec<T>, VecMutator<T, M>> for VectorMutation
where T: Clone + 'static, M: Mutator<T>,

Source§

impl<Value, M> Mutation<Value, M> for NoMutation
where Value: Clone + 'static, M: Mutator<Value>,