Struct sungod::Ra [−][src]
The struct that holds all the random state. Can be instanced as many times as you want!
Implementations
impl Ra
[src]
pub fn new_random() -> Self
[src]
Initalizes with the time since UNIX_EPOCH.
pub fn global<'t>() -> &'t mut Ra
[src]
This function is kinda “unsafe”, race conditions might corrupt the random state. I’d personally write this off as a “feature” since it’s just more noise!
It might be annoying if you’re trying to reproduce bugs tough, so beware.
pub fn new_with(seed: u64) -> Self
[src]
pub fn seed(&mut self, seed: u64)
[src]
pub fn xorwow(&mut self) -> u64
[src]
The random source, spits out random u64s
pub fn sample<T: Sample>(&mut self) -> T
[src]
Spits out a random of whatever.
pub fn gen<T: Sample>(&mut self) -> T
[src]
Spits out a random of whatever. Same as sample, but makes it easier to port from Rand.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,