soroban_sdk::prng

Trait GenLen

Source
pub trait GenLen {
    type Len;

    // Required method
    fn gen_len(prng: &Prng, len: Self::Len) -> Self;
}
Expand description

Implemented by types that support being generated of specific length by a Prng.

Required Associated Types§

Required Methods§

Source

fn gen_len(prng: &Prng, len: Self::Len) -> Self

Generates a value of the given implementing type with length with the Prng.

§Panics

If the length is greater than u32::MAX.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§