Struct puffin::trace::Trace

source ·
pub struct Trace<PT: ProtocolTypes> {
    pub descriptors: Vec<AgentDescriptor>,
    pub steps: Vec<Step<PT>>,
    pub prior_traces: Vec<Trace<PT>>,
}

Fields§

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

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

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

source

pub fn execute<PB>(&self, ctx: &mut TraceContext<PB>) -> 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<Trace<PT>, Error>

Trait Implementations§

source§

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

source§

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

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

impl<PT: Clone + ProtocolTypes> Clone for Trace<PT>

source§

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

Returns a copy 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<'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<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>

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: usize) -> 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
§

fn wrapped_as_testcase(&mut self)

An hook executed if the input is stored as Testcase
source§

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

source§

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

Mutate a given input
§

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

Post-process given the outcome of the 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>, _stage_idx: i32, ) -> Result<MutationResult, Error>

Mutate a given input
§

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

Post-process given the outcome of the 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>, _stage_idx: i32, ) -> Result<MutationResult, Error>

Mutate a given input
§

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

Post-process given the outcome of the 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>, _stage_idx: i32, ) -> Result<MutationResult, Error>

Mutate a given input
§

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

Post-process given the outcome of the 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>, _stage_idx: i32, ) -> Result<MutationResult, Error>

Mutate a given input
§

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

Post-process given the outcome of the 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>, _stage_idx: i32, ) -> Result<MutationResult, Error>

Mutate a given input
§

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

Post-process given the outcome of the 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>, _stage_idx: i32, ) -> Result<MutationResult, Error>

Mutate a given input
§

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

Post-process given the outcome of the 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: Send, <PT as ProtocolTypes>::Matcher: Send,

§

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

§

impl<PT> Unpin for Trace<PT>
where 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
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 + Sync + Send>

source§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.

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.

§

impl<I, S> MutatedTransform<I, S> for I
where I: Input + Clone, S: HasCorpus<Input = 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, _corpus_idx: CorpusId, ) -> 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<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting [TupleList], of an [Prepend::prepend()] call, including the prepended entry.
§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

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

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

source§

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

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

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

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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> MaybeHasScalabilityMonitor for T

§

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