Trait bolero::Driver [−][src]
pub trait Driver {
fn mode(&self) -> DriverMode;
fn fill_bytes(&mut self, bytes: &mut [u8]) -> Option<()>;
fn gen<T>(&mut self) -> Option<T>
where
T: TypeGenerator,
{ ... }
}
Expand description
Trait for driving the generation of a value
In a test engine, this is typically backed by a byte slice, but other drivers can be used instead, e.g. an RNG implementation.
Required methods
fn mode(&self) -> DriverMode
fn mode(&self) -> DriverMode
Return the mode set for the driver
Provided methods
fn gen<T>(&mut self) -> Option<T> where
T: TypeGenerator,
fn gen<T>(&mut self) -> Option<T> where
T: TypeGenerator,
Generate a value with type T