Trait libafl::corpus::Corpus [−][src]
pub trait Corpus<I>: Serialize + DeserializeOwned where
I: Input, { fn count(&self) -> usize; fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>; fn replace(
&mut self,
idx: usize,
testcase: Testcase<I>
) -> Result<(), Error>; fn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>; fn get(&self, idx: usize) -> Result<&RefCell<Testcase<I>>, Error>; fn current(&self) -> &Option<usize>; fn current_mut(&mut self) -> &mut Option<usize>; fn is_empty(&self) -> bool { ... } }
Expand description
Corpus with all current testcases
Required methods
fn count(&self) -> usize
[src]
fn count(&self) -> usize
[src]Returns the number of elements
fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
[src]
fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
[src]Add an entry to the corpus and return its index
Provided methods
Implementors
impl<I> Corpus<I> for InMemoryCorpus<I> where
I: Input,
[src]
impl<I> Corpus<I> for InMemoryCorpus<I> where
I: Input,
[src]fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
[src]
fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
[src]Add an entry to the corpus and return its index
fn replace(&mut self, idx: usize, testcase: Testcase<I>) -> Result<(), Error>
[src]
fn replace(&mut self, idx: usize, testcase: Testcase<I>) -> Result<(), Error>
[src]Replaces the testcase at the given idx
fn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>
[src]
fn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>
[src]Removes an entry from the corpus, returning it if it was present.
fn current_mut(&mut self) -> &mut Option<usize>
[src]
fn current_mut(&mut self) -> &mut Option<usize>
[src]Current testcase scheduled (mut)
impl<I> Corpus<I> for OnDiskCorpus<I> where
I: Input,
[src]
impl<I> Corpus<I> for OnDiskCorpus<I> where
I: Input,
[src]fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
[src]
fn add(&mut self, testcase: Testcase<I>) -> Result<usize, Error>
[src]Add an entry to the corpus and return its index
fn replace(&mut self, idx: usize, testcase: Testcase<I>) -> Result<(), Error>
[src]
fn replace(&mut self, idx: usize, testcase: Testcase<I>) -> Result<(), Error>
[src]Replaces the testcase at the given idx
fn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>
[src]
fn remove(&mut self, idx: usize) -> Result<Option<Testcase<I>>, Error>
[src]Removes an entry from the corpus, returning it if it was present.
fn current_mut(&mut self) -> &mut Option<usize>
[src]
fn current_mut(&mut self) -> &mut Option<usize>
[src]Current testcase scheduled (mut)