Trait Generator

Source
pub trait Generator<I, S> {
    // Required method
    fn generate(&mut self, state: &mut S) -> Result<I, Error>;
}
Expand description

Generators can generate ranges of bytes.

Required Methods§

Source

fn generate(&mut self, state: &mut S) -> Result<I, Error>

Generate a new input

Implementors§

Source§

impl<S> Generator<GramatronInput, S> for GramatronGenerator<'_, S>
where S: HasRand,

Source§

impl<S> Generator<ValueInput<Vec<u8>>, S> for RandBytesGenerator
where S: HasRand,

Source§

impl<S> Generator<ValueInput<Vec<u8>>, S> for RandPrintablesGenerator
where S: HasRand,

Source§

impl<S: HasRand> Generator<NautilusInput, S> for NautilusGenerator<'_>

Source§

impl<T, I, S> Generator<I, S> for T
where T: Iterator<Item = I>,

Iterators may be used as generators.

generate throws a Error::Empty if an input is requested but Iterator::next returns None.