Trait soroban_sdk::prng::GenRange
source · pub trait GenRange {
type RangeBound;
// Required method
fn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self;
}
Expand description
Implemented by types that support being generated in a specific range by a Prng.
Required Associated Types§
type RangeBound
Required Methods§
sourcefn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self
fn gen_range(prng: &Prng, r: impl RangeBounds<Self::RangeBound>) -> Self
Generates a value of the implementing type with the Prng in the specified range.
Panics
If the range is empty.
Object Safety§
This trait is not object safe.