pub struct Testcase<I>where
    I: Input,
{ /* private fields */ }
Expand description

An entry in the Testcase Corpus

Implementations§

source§

impl<I> Testcase<I>where
    I: Input,

Impl of a testcase

source

pub fn load_input(&mut self) -> Result<&I, Error>

Returns this testcase with a loaded input

source

pub fn store_input(&mut self) -> Result<bool, Error>

Store the input to disk if possible

source

pub fn input(&self) -> &Option<I>

Get the input, if any

source

pub fn input_mut(&mut self) -> &mut Option<I>

Get the input, if any (mutable)

source

pub fn set_input(&mut self, input: I)

Set the input

source

pub fn filename(&self) -> &Option<String>

Get the filename, if any

source

pub fn filename_mut(&mut self) -> &mut Option<String>

Get the filename, if any (mutable)

source

pub fn set_filename(&mut self, filename: String)

Set the filename

source

pub fn exec_time(&self) -> &Option<Duration>

Get the execution time of the testcase

source

pub fn exec_time_mut(&mut self) -> &mut Option<Duration>

Get the execution time of the testcase (mutable)

source

pub fn set_exec_time(&mut self, time: Duration)

Sets the execution time of the current testcase

source

pub fn executions(&self) -> &usize

Get the executions

source

pub fn executions_mut(&mut self) -> &mut usize

Get the executions (mutable)

source

pub fn fuzz_level(&self) -> usize

Get the fuzz_level

source

pub fn set_fuzz_level(&mut self, fuzz_level: usize)

Set the fuzz_level

source

pub fn fuzzed(&self) -> bool

Get if it was fuzzed

source

pub fn set_fuzzed(&mut self, fuzzed: bool)

Set if it was fuzzed

source

pub fn new(input: I) -> Self

Create a new Testcase instance given an input

source

pub fn with_filename(input: I, filename: String) -> Self

Create a new Testcase instance given an Input and a filename

source

pub fn with_executions(input: I, executions: usize) -> Self

Create a new Testcase instance given an Input and the number of executions

source§

impl<I> Testcase<I>where
    I: Input + HasLen,

Impl of a testcase when the input has len

source

pub fn cached_len(&mut self) -> Result<usize, Error>

Get the cached len

Trait Implementations§

source§

impl<I> Clone for Testcase<I>where
    I: Input + Clone,

source§

fn clone(&self) -> Testcase<I>

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<I> Debug for Testcase<I>where
    I: Input + Debug,

source§

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

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

impl<I> Default for Testcase<I>where
    I: Input,

source§

fn default() -> Self

Create a new default Testcase

source§

impl<'de, I> Deserialize<'de> for Testcase<I>where
    I: Input + DeserializeOwned,

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<I> From<I> for Testcase<I>where
    I: Input,

Create a testcase from an input

source§

fn from(input: I) -> Self

Converts to this type from the input type.
source§

impl<I> HasMetadata for Testcase<I>where
    I: Input,

source§

fn metadata(&self) -> &SerdeAnyMap

Get all the metadata into an hashbrown::HashMap

source§

fn metadata_mut(&mut self) -> &mut SerdeAnyMap

Get all the metadata into an hashbrown::HashMap (mutable)

source§

fn add_metadata<M>(&mut self, meta: M)where
    M: SerdeAny,

Add a metadata to the metadata map
source§

fn has_metadata<M>(&self) -> boolwhere
    M: SerdeAny,

Check for a metadata
source§

impl<I> Serialize for Testcase<I>where
    I: Input + DeserializeOwned,

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<I> !RefUnwindSafe for Testcase<I>

§

impl<I> !Send for Testcase<I>

§

impl<I> !Sync for Testcase<I>

§

impl<I> Unpin for Testcase<I>where
    I: Unpin,

§

impl<I> !UnwindSafe for Testcase<I>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

const: unstable · source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

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

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 Twhere
    T: Serialize + ?Sized,

source§

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

source§

impl<T> ToOwned for Twhere
    T: Clone,

§

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, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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