Struct necsim_impls_no_std::cogs::rng::rand::RandRng

source ·
pub struct RandRng<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> { /* private fields */ }

Implementations§

source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> RandRng<M, G>

source

pub fn into_inner(self) -> G

Trait Implementations§

source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> Backup for RandRng<M, G>

§

unsafe fn backup_unchecked(&self) -> Self

§

fn backup(&self) -> BackedUp<Self>

source§

impl<M: Clone + MathsCore, G: Clone + RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> Clone for RandRng<M, G>

source§

fn clone(&self) -> RandRng<M, G>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<M: MathsCore, G> ComputeTypeSet for RandRng<M, G>
where G: ComputeTypeSet + RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned,

§

type Output<__TypeSetRest: ExpandTypeSet> = <<__TypeSetRest as ComputeSet>::Output<PhantomData<M>> as ComputeSet>::Output<G>

Extend the set T into a (larger) set containing also the types this type links to. Read more
source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned + Debug> Debug for RandRng<M, G>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> Debug for RandRng<M, G>

source§

default fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> Deserialize<'de> for RandRng<M, G>

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> From<G> for RandRng<M, G>

source§

fn from(inner: G) -> Self

Converts to this type from the input type.
source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Send + Clone + Serialize + DeserializeOwned> RngCore<M> for RandRng<M, G>

§

type Seed = <G as SeedableRng>::Seed

source§

fn from_seed(seed: Self::Seed) -> Self

source§

fn sample_u64(&mut self) -> u64

source§

impl<M: MathsCore, G: RandRngCore + RandSeedableRng + Clone + Serialize + DeserializeOwned> Serialize for RandRng<M, G>

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
source§

impl<M: MathsCore, G> TypeLayout for RandRng<M, G>

§

type Inhabited = <And<<G as TypeLayout>::Inhabited, <And<<PhantomData<M> as TypeLayout>::Inhabited, Inhabited> as ComputeInhabited>::Output> as ComputeInhabited>::Output

Marker type for whether the type is inhabited or uninhabited. The associated type must be either [inhabited::Inhabited] or [inhabited::Uninhabited].
source§

const TYPE_LAYOUT: TypeLayoutInfo<'static> = _

Shallow layout of the type.

Auto Trait Implementations§

§

impl<M, G> Freeze for RandRng<M, G>
where G: Freeze,

§

impl<M, G> RefUnwindSafe for RandRng<M, G>

§

impl<M, G> Send for RandRng<M, G>
where G: Send,

§

impl<M, G> Sync for RandRng<M, G>
where G: Sync,

§

impl<M, G> Unpin for RandRng<M, G>
where G: Unpin, M: Unpin,

§

impl<M, G> UnwindSafe for RandRng<M, G>
where G: UnwindSafe, M: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Backup for T
where T: Clone,

§

default unsafe fn backup_unchecked(&self) -> T

§

default unsafe fn __contracts_impl_backup_unchecked(&self) -> T

§

fn backup(&self) -> BackedUp<Self>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ExtractDiscriminant for T

§

type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty

The type of the discriminant, which must satisfy the trait bounds required by core::mem::Discriminant. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<M, R> RngSampler<M> for R
where M: MathsCore, R: RngCore<M>,

§

fn sample_uniform_closed_open(&mut self) -> ClosedOpenUnitF64

Samples a uniform sample within [0.0, 1.0), i.e. 0.0 <= X < 1.0
§

fn sample_uniform_open_closed(&mut self) -> OpenClosedUnitF64

Samples a uniform sample within (0.0, 1.0], i.e. 0.0 < X <= 1.0
§

fn sample_index(&mut self, length: NonZero<usize>) -> usize

Contracts Read more
§

fn sample_index_u32(&mut self, length: NonZero<u32>) -> u32

Contracts Read more
§

fn sample_index_u64(&mut self, length: NonZero<u64>) -> u64

Contracts Read more
§

fn sample_index_u128(&mut self, length: NonZero<u128>) -> u128

Contracts Read more
§

fn sample_exponential(&mut self, lambda: PositiveF64) -> NonNegativeF64

§

fn sample_event(&mut self, probability: ClosedUnitF64) -> bool

§

fn sample_2d_standard_normal(&mut self) -> (f64, f64)

§

fn sample_2d_normal(&mut self, mu: f64, sigma: NonNegativeF64) -> (f64, f64)

§

impl<M, R> SeedableRng<M> for R
where M: MathsCore, R: RngCore<M>,

§

fn seed_from_u64(state: u64) -> Self

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> TypeGraphLayout for T
where T: TypeLayout + ComputeTypeSet,

§

const TYPE_GRAPH: TypeLayoutGraph<'static> = _

Shallow layout of the type.
source§

impl<T> Data for T
where T: Send + Clone,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Erased for T

source§

impl<T> PortableBitSemantics for T
where T: PortableBitSemantics + ?Sized,

source§

impl<T> StackOnly for T
where T: StackOnly,