pub struct RandomnessSource<M>where
M: ManagedTypeApi,{ /* private fields */ }
Implementations§
Source§impl<M> RandomnessSource<M>where
M: ManagedTypeApi,
impl<M> RandomnessSource<M>where
M: ManagedTypeApi,
pub fn new() -> RandomnessSource<M>
pub fn next_u8(&mut self) -> u8
Sourcepub fn next_u8_in_range(&mut self, min: u8, max: u8) -> u8
pub fn next_u8_in_range(&mut self, min: u8, max: u8) -> u8
Range is [min, max)
pub fn next_u16(&mut self) -> u16
Sourcepub fn next_u16_in_range(&mut self, min: u16, max: u16) -> u16
pub fn next_u16_in_range(&mut self, min: u16, max: u16) -> u16
Range is [min, max)
pub fn next_u32(&mut self) -> u32
Sourcepub fn next_u32_in_range(&mut self, min: u32, max: u32) -> u32
pub fn next_u32_in_range(&mut self, min: u32, max: u32) -> u32
Range is [min, max)
pub fn next_usize(&mut self) -> usize
Sourcepub fn next_usize_in_range(&mut self, min: usize, max: usize) -> usize
pub fn next_usize_in_range(&mut self, min: usize, max: usize) -> usize
Range is [min, max)
pub fn next_u64(&mut self) -> u64
Sourcepub fn next_u64_in_range(&mut self, min: u64, max: u64) -> u64
pub fn next_u64_in_range(&mut self, min: u64, max: u64) -> u64
Range is [min, max)
pub fn next_bytes(&mut self, len: usize) -> ManagedBuffer<M>
Trait Implementations§
Source§impl<M> Default for RandomnessSource<M>where
M: ManagedTypeApi,
impl<M> Default for RandomnessSource<M>where
M: ManagedTypeApi,
Source§fn default() -> RandomnessSource<M>
fn default() -> RandomnessSource<M>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<M> Freeze for RandomnessSource<M>
impl<M> RefUnwindSafe for RandomnessSource<M>
impl<M> Send for RandomnessSource<M>
impl<M> Sync for RandomnessSource<M>
impl<M> Unpin for RandomnessSource<M>
impl<M> UnwindSafe for RandomnessSource<M>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more