pub struct InMemoryCorpus<I> where
I: Input, { /* private fields */ }
Expand description
A corpus handling all in memory.
Implementations
sourceimpl<I> InMemoryCorpus<I> where
I: Input,
impl<I> InMemoryCorpus<I> where
I: Input,
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new InMemoryCorpus
, keeping all Testcase
s
in memory.
This is the simplest and fastest option, however test progress will be lost on exit or on OOM.
Trait Implementations
sourceimpl<I: Clone> Clone for InMemoryCorpus<I> where
I: Input,
impl<I: Clone> Clone for InMemoryCorpus<I> where
I: Input,
sourcefn clone(&self) -> InMemoryCorpus<I>
fn clone(&self) -> InMemoryCorpus<I>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<I> Corpus<I> for InMemoryCorpus<I> where
I: Input,
impl<I> Corpus<I> for InMemoryCorpus<I> where
I: Input,
sourcefn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
Add an entry to the corpus and return its index
sourcefn replace(&mut self, idx: usize, testcase: Testcase<I>) -> Result<(), Error>
fn replace(&mut self, idx: usize, testcase: Testcase<I>) -> Result<(), Error>
Replaces the testcase at the given idx
sourcefn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>
fn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>
Removes an entry from the corpus, returning it if it was present.
sourcefn current_mut(&mut self) -> &mut Option<usize>
fn current_mut(&mut self) -> &mut Option<usize>
Current testcase scheduled (mutable)
sourceimpl<I: Debug> Debug for InMemoryCorpus<I> where
I: Input,
impl<I: Debug> Debug for InMemoryCorpus<I> where
I: Input,
sourceimpl<I: Default> Default for InMemoryCorpus<I> where
I: Input,
impl<I: Default> Default for InMemoryCorpus<I> where
I: Input,
sourcefn default() -> InMemoryCorpus<I>
fn default() -> InMemoryCorpus<I>
Returns the “default value” for a type. Read more
sourceimpl<'de, I> Deserialize<'de> for InMemoryCorpus<I> where
I: Input,
I: DeserializeOwned,
impl<'de, I> Deserialize<'de> for InMemoryCorpus<I> where
I: Input,
I: DeserializeOwned,
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<I> Serialize for InMemoryCorpus<I> where
I: Input,
I: DeserializeOwned,
impl<I> Serialize for InMemoryCorpus<I> where
I: Input,
I: DeserializeOwned,
Auto Trait Implementations
impl<I> !RefUnwindSafe for InMemoryCorpus<I>
impl<I> !Send for InMemoryCorpus<I>
impl<I> !Sync for InMemoryCorpus<I>
impl<I> Unpin for InMemoryCorpus<I> where
I: Unpin,
impl<I> !UnwindSafe for InMemoryCorpus<I>
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
sourceimpl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
type PreprendResult = Tail
type PreprendResult = Tail
The Resulting TupleList
, of an Prepend::prepend()
call,
including the prepended entry. Read more
sourcefn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.