pub struct ValidatorSetPRNG { /* private fields */ }Expand description
Random generator used for validator subset calculation.
Implementations§
Source§impl ValidatorSetPRNG
impl ValidatorSetPRNG
Sourcepub fn new(shard_ident: ShardIdent, cc_seqno: u32) -> Self
pub fn new(shard_ident: ShardIdent, cc_seqno: u32) -> Self
Creates a new generator with zero seed.
Sourcepub fn with_seed(
shard_ident: ShardIdent,
cc_seqno: u32,
seed: &[u8; 32],
) -> Self
pub fn with_seed( shard_ident: ShardIdent, cc_seqno: u32, seed: &[u8; 32], ) -> Self
Creates a new generator with the specified seed.
Sourcepub fn next_ranged(&mut self, range: u64) -> u64
pub fn next_ranged(&mut self, range: u64) -> u64
Generates next u64 multiplied by the specified range.
Auto Trait Implementations§
impl Freeze for ValidatorSetPRNG
impl RefUnwindSafe for ValidatorSetPRNG
impl Send for ValidatorSetPRNG
impl Sync for ValidatorSetPRNG
impl Unpin for ValidatorSetPRNG
impl UnwindSafe for ValidatorSetPRNG
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more