Trace

Struct Trace 

Source
pub struct Trace<PT: ProtocolTypes> {
    pub descriptors: Vec<AgentDescriptor<PT::PUTConfig>>,
    pub steps: Vec<Step<PT>>,
    pub prior_traces: Vec<Trace<PT>>,
    pub metadata_trace: MetadataTrace,
}

Fields§

§descriptors: Vec<AgentDescriptor<PT::PUTConfig>>§steps: Vec<Step<PT>>§prior_traces: Vec<Trace<PT>>§metadata_trace: MetadataTrace

Implementations§

Source§

impl<PT: ProtocolTypes> Trace<PT>

Source

pub fn dot_graph(&self, tree_mode: bool) -> String

Source

pub fn dot_subgraphs(&self, tree_mode: bool) -> Vec<String>

Source§

impl<PT: ProtocolTypes> Trace<PT>

Source

pub fn count_functions_by_name(&self, find_name: &'static str) -> usize

Source

pub fn count_functions(&self) -> usize

Source

pub fn write_plots(&self, i: u16)

Source§

impl<PT: ProtocolTypes> Trace<PT>

A Trace consists of several Steps. Each has either a OutputAction or an InputAction. Each Steps references an Agent by name. Furthermore, a trace also has a list of AgentDescriptors which act like a blueprint to spawn Agents with a corresponding server or client role and a specific TLs version. Essentially they are an Agent without a stream.

Source

pub fn all_descriptors(&self) -> Vec<&AgentDescriptor<PT::PUTConfig>>

Recursively collect all agent descriptors from this trace and its prior traces. This is needed for differential testing: agents in prior traces must also be mapped to the correct PUT, otherwise they silently fall back to the default.

Source

pub fn spawn_agents<PB: ProtocolBehavior<ProtocolTypes = PT>>( &self, ctx: &mut TraceContext<PB>, ) -> Result<(), Error>

Source

pub fn execute_until_step_wrap<PB>( &self, ctx: &mut TraceContext<PB>, stop_at_step: usize, trace_number: &mut usize, check_security_violation: bool, ) -> Result<(), Error>
where PB: ProtocolBehavior<ProtocolTypes = PT>,

Source

pub fn execute_until_step<PB>( &self, ctx: &mut TraceContext<PB>, stop_at_step: usize, trace_number: &mut usize, check_security_violation: bool, ) -> Result<(), Error>
where PB: ProtocolBehavior<ProtocolTypes = PT>,

Source

pub fn execute<PB>( &self, ctx: &mut TraceContext<PB>, trace_number: &mut usize, check_security_violation: bool, ) -> Result<(), Error>
where PB: ProtocolBehavior<ProtocolTypes = PT>,

Source

pub fn serialize_postcard(&self) -> Result<Vec<u8>, Error>

Source

pub fn deserialize_postcard(slice: &[u8]) -> Result<Self, Error>

Source

pub fn all_payloads(&self) -> Vec<&Payloads>

Source

pub fn all_payloads_mut(&mut self) -> Vec<&mut Payloads>

Source

pub fn is_symbolic(&self) -> bool

Source

pub fn truncate_at_step(&mut self, after_step: usize)

Remove the steps after (excluding) after_step

Source

pub fn size(&self) -> usize

Size of trace (summing all input sizes, counting one for output)

Source

pub fn set_focus(&mut self, trace_path: TracePath)

Sets in the metadata the focus of the trace to a specific TracePath.

Source

pub fn clear_focus(&mut self)

Clear from the metadata any focus

Source

pub fn get_focus(&self) -> Option<&TracePath>

Returns the current focus path from the metadata, if any

Trait Implementations§

Source§

impl<PT: ProtocolTypes> AsRef<Trace<PT>> for Trace<PT>

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<PT: Clone + ProtocolTypes> Clone for Trace<PT>
where PT::PUTConfig: Clone,

Source§

fn clone(&self) -> Trace<PT>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<PT: ProtocolTypes> Debug for Trace<PT>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<PT: ProtocolTypes> Default for Trace<PT>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, PT> Deserialize<'de> for Trace<PT>
where PT: ProtocolTypes,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<PT: ProtocolTypes> Display for Trace<PT>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<EM, OT, SC, PT> Feedback<EM, Trace<PT>, OT, SC> for MinimizingFeedback<SC, PT>
where SC: HasRand + HasMaxSize, PT: ProtocolTypes + 'static, EM: EventFirer<Trace<PT>, SC>, OT: ObserversTuple<Trace<PT>, SC>,

Source§

fn append_metadata( &mut self, _state: &mut SC, _manager: &mut EM, _observers: &OT, testcase: &mut Testcase<Trace<PT>>, ) -> Result<(), Error>

Append to the testcase the generated metadata in case of a new corpus item

Source§

fn is_interesting( &mut self, _: &mut SC, _: &mut EM, _: &Trace<PT>, _: &OT, _: &ExitKind, ) -> Result<bool, Error>

is_interesting return if an input is worth the addition to the corpus
Source§

fn is_interesting_introspection( &mut self, _: &mut SC, _: &mut EM, _: &Trace<PT>, _: &OT, _: &ExitKind, ) -> Result<bool, Error>

Returns if the result of a run is interesting and the value input should be stored in a corpus. It also keeps track of introspection stats.
Source§

impl<PT: ProtocolTypes> HasLen for Trace<PT>

Source§

fn len(&self) -> usize

The length
§

fn is_empty(&self) -> bool

Returns true if it has no elements.
Source§

impl<PT: Hash + ProtocolTypes> Hash for Trace<PT>
where PT::PUTConfig: Hash,

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<PT: ProtocolTypes> Input for Trace<PT>

Source§

fn generate_name(&self, _idx: Option<CorpusId>) -> String

Generate a name for this input, the user is responsible for making each name of testcase unique.
§

fn to_file<P>(&self, path: P) -> Result<(), Error>
where P: AsRef<Path>,

Write this input to the file
§

fn from_file<P>(path: P) -> Result<Self, Error>
where P: AsRef<Path>,

Load the content of this input from a file
Source§

impl<'a, S, PB: ProtocolBehavior> Mutator<Trace<<PB as ProtocolBehavior>::ProtocolTypes>, S> for GenerateMutator<'a, S, PB>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PB::ProtocolTypes>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BitFlipMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteAddMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteDecMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteFlipMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteIncMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteInterestingMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteNegMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for ByteRandMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesCopyMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesDeleteMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesExpandMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesInsertCopyMutatorDY<S>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesInsertMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesLargeExpandMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesRandInsertMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesRandSetMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesSetMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for BytesSwapMutatorDY<S>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for CrossoverInsertMutatorDY<S, PT>
where S: HasCorpus<Trace<PT>> + HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for CrossoverReplaceMutatorDY<S, PT>
where S: HasCorpus<Trace<PT>> + HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for DwordAddMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for DwordInterestingMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<'a, S, PT: ProtocolTypes, PB> Mutator<Trace<PT>, S> for MakeMessage<'a, PB>
where S: HasRand, PB: ProtocolBehavior<ProtocolTypes = PT>,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for QwordAddMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<'a, S, PT: ProtocolTypes, PB> Mutator<Trace<PT>, S> for ReadMessage<'a, PB>
where S: HasRand, PB: ProtocolBehavior<ProtocolTypes = PT>,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT: ProtocolTypes> Mutator<Trace<PT>, S> for RemoveAndLiftMutator<S>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT: ProtocolTypes> Mutator<Trace<PT>, S> for RepeatMutator<S>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT: ProtocolTypes> Mutator<Trace<PT>, S> for ReplaceMatchMutator<S, PT>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT: ProtocolTypes> Mutator<Trace<PT>, S> for ReplaceReuseMutator<S>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT: ProtocolTypes> Mutator<Trace<PT>, S> for SkipMutator<S>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for SpliceMutatorDY<S, PT>
where S: HasCorpus<Trace<PT>> + HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT, M> Mutator<Trace<PT>, S> for StepLockedStackMutator<PT, M>
where S: HasRand, PT: ProtocolTypes, M: Mutator<Trace<PT>, S>,

Source§

fn mutate( &mut self, state: &mut S, input: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, state: &mut S, id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT: ProtocolTypes> Mutator<Trace<PT>, S> for SwapMutator<S>
where S: HasRand,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for WordAddMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<S, PT> Mutator<Trace<PT>, S> for WordInterestingMutatorDY<S, PT>
where S: HasRand + HasMaxSize, PT: ProtocolTypes,

Source§

fn mutate( &mut self, state: &mut S, trace: &mut Trace<PT>, ) -> Result<MutationResult, Error>

Mutate a given input
Source§

fn post_exec( &mut self, _state: &mut S, _new_corpus_id: Option<CorpusId>, ) -> Result<(), Error>

Post-process given the outcome of the execution new_corpus_id will be Some if a new [crate::corpus::Testcase] was created this execution.
Source§

impl<PT> Serialize for Trace<PT>
where PT: ProtocolTypes,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<PT> Freeze for Trace<PT>

§

impl<PT> !RefUnwindSafe for Trace<PT>

§

impl<PT> Send for Trace<PT>
where <PT as ProtocolTypes>::PUTConfig: Send, PT: Send, <PT as ProtocolTypes>::Matcher: Send,

§

impl<PT> Sync for Trace<PT>
where <PT as ProtocolTypes>::PUTConfig: Sync, PT: Sync, <PT as ProtocolTypes>::Matcher: Sync,

§

impl<PT> Unpin for Trace<PT>
where <PT as ProtocolTypes>::PUTConfig: Unpin, PT: Unpin, <PT as ProtocolTypes>::Matcher: Unpin,

§

impl<PT> !UnwindSafe for Trace<PT>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<Head, T> Append<T> for Head

§

fn append(self, value: T) -> (Head, T)

Append Value and return the tuple
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for T
where T: Any + Clone + Send + Sync,

§

fn clone_any(&self) -> Box<dyn CloneAny>

§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send>

§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync>

§

fn clone_any_send_sync(&self) -> Box<dyn CloneAny + Send + Sync>

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<I, S> MutatedTransform<I, S> for I
where I: Clone, S: HasCorpus<I>,

§

type Post = ()

Type indicating actions to be taken after the post-transformation input is executed
§

fn try_transform_from(base: &mut Testcase<I>, state: &S) -> Result<I, Error>

Transform the provided testcase into this type
§

fn try_transform_into( self, _state: &S, ) -> Result<(I, <I as MutatedTransform<I, S>>::Post), Error>

Transform this instance back into the original input type
§

impl<T> Paint for T
where T: ?Sized,

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

impl<Tail, T> Prepend<T> for Tail

§

fn prepend(self, value: T) -> (T, Tail)

Prepend a value to this tuple, returning a new tuple with prepended value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

§

impl<T> ToCompactString for T
where T: Display,

§

fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>

Fallible version of [ToCompactString::to_compact_string()] Read more
§

fn to_compact_string(&self) -> CompactString

Converts the given value to a [CompactString]. Read more
§

impl<T> ToLine for T
where T: Display,

§

fn to_line(&self) -> Line<'_>

Converts the value to a [Line].
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> ToSpan for T
where T: Display,

§

fn to_span(&self) -> Span<'_>

Converts the value to a [Span].
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> ToText for T
where T: Display,

§

fn to_text(&self) -> Text<'_>

Converts the value to a [Text].
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> DebugAny for T
where T: Any + Debug,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> UnsafeAny for T
where T: Any,