Module fixt::prelude

source ·

Re-exports

pub use crate::bool::BoolFixturator;
pub use crate::bytes::Bytes;
pub use crate::bytes::BytesFixturator;
pub use crate::bytes::BytesNotEmpty;
pub use crate::bytes::BytesNotEmptyFixturator;
pub use crate::bytes::SixtyFourBytesFixturator;
pub use crate::bytes::SixtyFourBytesVecFixturator;
pub use crate::bytes::ThirtySixBytesFixturator;
pub use crate::bytes::ThirtyTwoBytesFixturator;
pub use crate::serialized_bytes::SerializedBytesFixturator;
pub use crate::string::CharFixturator;
pub use crate::string::StringFixturator;
pub use crate::unit::UnitFixturator;
pub use crate::Empty;
pub use crate::Fixturator;
pub use crate::Predictable;
pub use crate::Unpredictable;
pub use strum_macros;
pub use crate::number::*;

Macros

implement Iterator for a FooFixturator for a given curve
Creates a simple way to generate enums that use the strum way of iterating https://docs.rs/strum/0.18.0/strum/ iterates over all the variants (Predictable) or selects random variants (Unpredictable) You do still need to BYO “empty” variant as the macro doesn’t know what to use there
tiny convenience macro to make it easy to get the first Foo from its fixturator without using the iterator interface to save a little typing c.f. fixt!(Foo) vs. FooFixturator::new(Unpredictable).next().unwrap();
implements a FooFixturator for any type Foo this simply wraps Fixturator<Foo, Curve> up as FooFixturator<Curve>
a direct delegation of fixtures to the inner type for new types
a direct delegation of fixtures to the inner type for wasm io types See zome types crate

Structs

The standard RNG. The PRNG algorithm in StdRng is chosen to be efficient on the current platform, to be statistically strong and unpredictable (meaning a cryptographically secure PRNG).
A reference to the thread-local generator

Traits

A marker trait used to indicate that an RngCore or BlockRngCore implementation is supposed to be cryptographically secure.
Types (distributions) that can be used to create a random instance of T.
This trait designates that an Enum can be iterated over. It can be auto generated using strum_macros on your behalf.
Extension trait on iterators, providing random sampling methods.
An automatically-implemented extension trait on RngCore providing high-level generic methods for sampling values and other convenience methods.
The core of a random number generator.
A random number generator that can be explicitly seeded.
Extension trait on slices, providing random mutation and sampling methods.

Functions

Generates a random value using the thread-local random number generator.
Retrieve the lazily-initialized thread-local random number generator, seeded by the system. Intended to be used in method chaining style, e.g. thread_rng().gen::<i32>(), or cached locally, e.g. let mut rng = thread_rng();. Invoked by the Default trait, making ThreadRng::default() equivalent.