Skip to main content

RandomCoreEffects

Trait RandomCoreEffects 

Source
pub trait RandomCoreEffects: Send + Sync {
    // Required methods
    fn random_bytes<'life0, 'async_trait>(
        &'life0 self,
        len: usize,
    ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn random_bytes_32<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = [u8; 32]> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn random_u64<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Core random effects for generating random values.

This trait provides cryptographically secure random number generation for the Aura effects system. Implementations in handlers provide:

  • Production: System cryptographic RNG
  • Testing: Deterministic seeded RNG for reproducible tests
  • Simulation: Controlled randomness for scenario testing

Required Methods§

Source

fn random_bytes<'life0, 'async_trait>( &'life0 self, len: usize, ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Generate random bytes of specified length

Source

fn random_bytes_32<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = [u8; 32]> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Generate 32 random bytes as array

Source

fn random_u64<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Generate a random u64 value

Implementations on Foreign Types§

Source§

impl<T> RandomCoreEffects for Arc<T>

Blanket implementation for Arc where T: RandomCoreEffects

Source§

fn random_bytes<'life0, 'async_trait>( &'life0 self, len: usize, ) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Source§

fn random_bytes_32<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = [u8; 32]> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Source§

fn random_u64<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>
where 'life0: 'async_trait, Arc<T>: 'async_trait,

Implementors§