CanGenerateRandom

Trait CanGenerateRandom 

Source
pub trait CanGenerateRandom<T: Async>: Async {
    // Required methods
    fn generate_random(&self) -> impl Future<Output = T> + Send;
    fn random_range(&self, min: T, max: T) -> impl Future<Output = T> + Send;
}

Required Methods§

Source

fn generate_random(&self) -> impl Future<Output = T> + Send

Source

fn random_range(&self, min: T, max: T) -> impl Future<Output = T> + Send

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§

Source§

impl<Runtime, T: Async> CanGenerateRandom<T> for Runtime
where Runtime: Async + HasComponents, Runtime::Components: RandomGenerator<Runtime, T>,