[−][src]Struct solana_libra_proptest_helpers::ValueGenerator
Context for generating single values out of strategies.
Proptest is designed to be built around "value trees", which represent a spectrum from complex values to simpler ones. But in some contexts, like benchmarking or generating corpuses, one just wants a single value. This is a convenience struct for that.
Methods
impl ValueGenerator
[src]
pub fn new() -> Self
[src]
Creates a new value generator with the default RNG.
pub fn deterministic() -> Self
[src]
Creates a new value generator with a deterministic RNG.
This generator has a hardcoded seed, so its results are predictable across test runs. However, a new proptest version may change the seed.
pub fn generate<S: Strategy>(&mut self, strategy: S) -> S::Value
[src]
Generates a single value for this strategy.
Panics if generating the new value fails. The only situation in which this can happen is if generating the value causes too many internal rejects.
Auto Trait Implementations
impl !RefUnwindSafe for ValueGenerator
impl Send for ValueGenerator
impl Sync for ValueGenerator
impl Unpin for ValueGenerator
impl !UnwindSafe for ValueGenerator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,