Struct LegacyRandom
pub struct LegacyRandom { /* private fields */ }Implementations§
§impl LegacyRandom
impl LegacyRandom
pub fn new(seed: i64) -> LegacyRandom
pub const fn from_state(state: u64) -> LegacyRandom
pub const fn from_state(state: u64) -> LegacyRandom
Construct from an already-masked 48-bit state.
Trait Implementations§
§impl Clone for LegacyRandom
impl Clone for LegacyRandom
§fn clone(&self) -> LegacyRandom
fn clone(&self) -> LegacyRandom
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for LegacyRandom
impl Debug for LegacyRandom
§impl From<(u64, Option<f64>)> for LegacyRandom
A generator from its state (masked to 48 bits) and cached gaussian.
impl From<(u64, Option<f64>)> for LegacyRandom
A generator from its state (masked to 48 bits) and cached gaussian.
§impl RandomSource for LegacyRandom
impl RandomSource for LegacyRandom
type Positional = LegacyPositionalRandom
fn fork_positional(&mut self) -> <LegacyRandom as RandomSource>::Positional
fn set_seed(&mut self, seed: i64)
fn next_int(&mut self) -> i32
fn next_int_bound(&mut self, bound: i32) -> Result<i32, InvalidBound>
fn next_long(&mut self) -> i64
fn next_boolean(&mut self) -> bool
fn next_float(&mut self) -> f32
fn next_double(&mut self) -> f64
§fn next_gaussian(&mut self) -> f64
fn next_gaussian(&mut self) -> f64
MarsagliaPolarGaussian over this source; the cached second value is
part of the source state (reset by
set_seed where vanilla resets it).fn fork(&mut self) -> LegacyRandom
fn consume_count(&mut self, count: i32)
fn next_int_between_inclusive( &mut self, min: i32, max: i32, ) -> Result<i32, InvalidBound>
fn next_int_between( &mut self, origin: i32, bound: i32, ) -> Result<i32, InvalidBound>
fn triangle(&mut self, mean: f64, deviation: f64) -> f64
fn triangle_float(&mut self, mean: f32, deviation: f32) -> f32
§impl Wire for LegacyRandom
The whole generator, through its own constructor, which masks the state to 48 bits.
impl Wire for LegacyRandom
The whole generator, through its own constructor, which masks the state to 48 bits.
impl WorldgenSource for LegacyRandom
Auto Trait Implementations§
impl Freeze for LegacyRandom
impl RefUnwindSafe for LegacyRandom
impl Send for LegacyRandom
impl Sync for LegacyRandom
impl Unpin for LegacyRandom
impl UnsafeUnpin for LegacyRandom
impl UnwindSafe for LegacyRandom
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