pub trait TupleMutator<T, TupleKind>: Sized + 'static where
TupleKind: RefTypes,
T: TupleStructure<TupleKind>, {
type Cache: Clone;
type MutationStep: Clone;
type ArbitraryStep: Clone;
type UnmutateToken;
type RecursingPartIndex: Clone;
fn default_arbitrary_step(&self) -> Self::ArbitraryStep;
fn complexity<'a>(
&self,
value: TupleKind::Ref,
cache: &'a Self::Cache
) -> f64;
fn validate_value<'a>(
&self,
value: TupleKind::Ref
) -> Option<(Self::Cache, Self::MutationStep)>;
fn max_complexity(&self) -> f64;
fn min_complexity(&self) -> f64;
fn ordered_arbitrary(
&self,
step: &mut Self::ArbitraryStep,
max_cplx: f64
) -> Option<(T, f64)>;
fn random_arbitrary(&self, max_cplx: f64) -> (T, f64);
fn ordered_mutate<'a>(
&self,
value: TupleKind::Mut,
cache: &'a mut Self::Cache,
step: &'a mut Self::MutationStep,
max_cplx: f64
) -> Option<(Self::UnmutateToken, f64)>;
fn random_mutate<'a>(
&self,
value: TupleKind::Mut,
cache: &'a mut Self::Cache,
max_cplx: f64
) -> (Self::UnmutateToken, f64);
fn unmutate<'a>(
&self,
value: TupleKind::Mut,
cache: &'a mut Self::Cache,
t: Self::UnmutateToken
);
fn default_recursing_part_index<'a>(
&self,
value: TupleKind::Ref,
cache: &Self::Cache
) -> Self::RecursingPartIndex;
fn recursing_part<'a, V, N>(
&self,
parent: &N,
value: TupleKind::Ref,
index: &mut Self::RecursingPartIndex
) -> Option<&'a V>
where
V: Clone + 'static,
N: Mutator<V>;
}