Trait soroban_sdk::prng::Gen

source ·
pub trait Gen {
    // Required method
    fn gen(prng: &Prng) -> Self;
}
Expand description

Implemented by types that support being generated by a Prng.

Required Methods§

source

fn gen(prng: &Prng) -> Self

Generates a value of the implementing type with the Prng.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Gen for u64

source§

fn gen(prng: &Prng) -> Self

source§

impl<const N: usize> Gen for [u8; N]

source§

fn gen(prng: &Prng) -> Self

Generates the array with the Prng.

Panics

If the array is greater than u32::MAX in length.

Implementors§

source§

impl<const N: usize> Gen for BytesN<N>