pub enum AST {
// some variants omitted
}
grammar_mutator
only.Expand description
An abstract syntax tree.
It can be serialized with SerdeSerializer
on crate feature serde_json_serializer
Implementations
Trait Implementations
sourceimpl<'de> Deserialize<'de> for AST
impl<'de> Deserialize<'de> for AST
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Mutator<AST> for ASTMutator
impl Mutator<AST> for ASTMutator
type MutationStep: Clone
type MutationStep: Clone
Contains information about what mutations have already been tried.
type ArbitraryStep: Clone
type ArbitraryStep: Clone
Contains information about what arbitrary values have already been generated.
type UnmutateToken
type UnmutateToken
Describes how to reverse a mutation
sourcefn default_arbitrary_step(&self) -> Self::ArbitraryStep
fn default_arbitrary_step(&self) -> Self::ArbitraryStep
The first ArbitraryStep
value to be passed to ordered_arbitrary
sourcefn is_valid(&self, value: &Value) -> bool
fn is_valid(&self, value: &Value) -> bool
Quickly verifies that the value conforms to the mutator’s expectations
sourcefn validate_value(&self, value: &Value) -> Option<Self::Cache>
fn validate_value(&self, value: &Value) -> Option<Self::Cache>
sourcefn 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. Read more
sourcefn 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
sourcefn max_complexity(&self) -> f64
fn max_complexity(&self) -> f64
The maximum complexity that a value can possibly have.
sourcefn min_complexity(&self) -> f64
fn min_complexity(&self) -> f64
The minimum complexity that a value can possibly have.
sourcefn 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
sourcefn 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 more
sourcefn random_arbitrary(&self, max_cplx: f64) -> (Value, f64)
fn random_arbitrary(&self, max_cplx: f64) -> (Value, f64)
Generates an entirely new value. Read more
sourcefn 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 more
sourcefn 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
sourcefn 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
. Read more
impl Eq for AST
impl StructuralEq for AST
impl StructuralPartialEq for AST
Auto Trait Implementations
impl RefUnwindSafe for AST
impl Send for AST
impl Sync for AST
impl Unpin for AST
impl UnwindSafe for AST
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