pub struct OnDiskCorpus<I> where
I: Input, { /* private fields */ }
Expand description
A corpus able to store testcases to disk, and load them from disk, when they are being used.
Implementations
sourceimpl<I> OnDiskCorpus<I> where
I: Input,
impl<I> OnDiskCorpus<I> where
I: Input,
sourcepub fn new<P>(dir_path: P) -> Result<Self, Error> where
P: AsRef<Path>,
pub fn new<P>(dir_path: P) -> Result<Self, Error> where
P: AsRef<Path>,
Creates the OnDiskCorpus
.
Will error, if std::fs::create_dir_all()
failed for dir_path
.
sourcepub fn new_save_meta(
dir_path: PathBuf,
meta_format: Option<OnDiskMetadataFormat>
) -> Result<Self, Error>
pub fn new_save_meta(
dir_path: PathBuf,
meta_format: Option<OnDiskMetadataFormat>
) -> Result<Self, Error>
Creates the OnDiskCorpus
specifying the type of Metadata
to be saved to disk.
Will error, if std::fs::create_dir_all()
failed for dir_path
.
Trait Implementations
sourceimpl<I: Clone> Clone for OnDiskCorpus<I> where
I: Input,
impl<I: Clone> Clone for OnDiskCorpus<I> where
I: Input,
sourcefn clone(&self) -> OnDiskCorpus<I>
fn clone(&self) -> OnDiskCorpus<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 OnDiskCorpus<I> where
I: Input,
impl<I> Corpus<I> for OnDiskCorpus<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 OnDiskCorpus<I> where
I: Input,
impl<I: Debug> Debug for OnDiskCorpus<I> where
I: Input,
sourceimpl<I: Default> Default for OnDiskCorpus<I> where
I: Input,
impl<I: Default> Default for OnDiskCorpus<I> where
I: Input,
sourcefn default() -> OnDiskCorpus<I>
fn default() -> OnDiskCorpus<I>
Returns the “default value” for a type. Read more
sourceimpl<'de, I> Deserialize<'de> for OnDiskCorpus<I> where
I: Input,
I: DeserializeOwned,
impl<'de, I> Deserialize<'de> for OnDiskCorpus<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 OnDiskCorpus<I> where
I: Input,
I: DeserializeOwned,
impl<I> Serialize for OnDiskCorpus<I> where
I: Input,
I: DeserializeOwned,
Auto Trait Implementations
impl<I> !RefUnwindSafe for OnDiskCorpus<I>
impl<I> !Send for OnDiskCorpus<I>
impl<I> !Sync for OnDiskCorpus<I>
impl<I> Unpin for OnDiskCorpus<I> where
I: Unpin,
impl<I> !UnwindSafe for OnDiskCorpus<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.