[][src]Trait libra_fuzzer::FuzzTargetImpl

pub trait FuzzTargetImpl: Sync + Send + Debug {
    fn description(&self) -> &'static str;
fn generate(
        &self,
        _idx: usize,
        _gen: &mut ValueGenerator
    ) -> Option<Vec<u8>>;
fn fuzz(&self, data: &[u8]); fn name(&self) -> &'static str { ... } }

Implementation for a particular target of a fuzz operation.

Required methods

fn description(&self) -> &'static str

A description for this target.

fn generate(&self, _idx: usize, _gen: &mut ValueGenerator) -> Option<Vec<u8>>

Generates a new example for this target to store in the corpus. idx is the current index of the item being generated, starting from 0.

Returns Some(bytes) if a value was generated, or None if no value can be generated.

fn fuzz(&self, data: &[u8])

Fuzz the target with this data. The fuzzer tests for panics or OOMs with this method.

Loading content...

Provided methods

fn name(&self) -> &'static str

The name of the fuzz target. By default, we use the struct name, however, implementations may prefer to override this.

Loading content...

Implementors

Loading content...