Struct libafl::corpus::testcase::Testcase[][src]

pub struct Testcase<I> where
    I: Input
{ /* fields omitted */ }

An entry in the Testcase Corpus

Implementations

impl<I> Testcase<I> where
    I: Input
[src]

Impl of a testcase

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

Returns this testcase with a loaded input

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

Store the input to disk if possible

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

Get the input, if any

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

Get the input, if any (mutable)

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

Set the input

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

Get the filename, if any

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

Get the filename, if any (mutable)

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

Set the filename

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

Get the execution time of the testcase

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

Get the execution time of the testcase (mut)

pub fn new<T>(input: T) -> Self where
    T: Into<I>, 
[src]

Create a new Testcase instace given an input

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

Create a new Testcase instance given an Input and a filename

#[must_use]
pub fn default() -> Self
[src]

Create a new, empty, Testcase.

impl<I> Testcase<I> where
    I: Input + HasLen
[src]

Impl of a testcase when the input has len

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

Get the cached len

Trait Implementations

impl<I: Clone> Clone for Testcase<I> where
    I: Input
[src]

fn clone(&self) -> Testcase<I>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<I: Debug> Debug for Testcase<I> where
    I: Input
[src]

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

Formats the value using the given formatter. Read more

impl<I: Default> Default for Testcase<I> where
    I: Input
[src]

fn default() -> Testcase<I>[src]

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

impl<'de, I> Deserialize<'de> for Testcase<I> where
    I: Input,
    I: DeserializeOwned
[src]

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

Deserialize this value from the given Serde deserializer. Read more

impl<I> From<I> for Testcase<I> where
    I: Input
[src]

Create a testcase from an input

fn from(input: I) -> Self[src]

Performs the conversion.

impl<I> HasMetadata for Testcase<I> where
    I: Input
[src]

fn metadata(&self) -> &SerdeAnyMap[src]

Get all the metadata into an hashbrown::HashMap

fn metadata_mut(&mut self) -> &mut SerdeAnyMap[src]

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

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

Add a metadata to the metadata map

fn has_metadata<M>(&self) -> bool where
    M: SerdeAny
[src]

Check for a metadata

impl<I> Serialize for Testcase<I> where
    I: Input,
    I: DeserializeOwned
[src]

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

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<!> for T[src]

pub fn from(t: !) -> T[src]

Performs the conversion.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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