pub struct Enumerator;Expand description
Produces all possible outputs of the random process, with repetition, as a
Vec.
Enumerator can be preferable to Counter in applications where the
functions passed to fmap_rand do not typically produce the same value for
different random inputs. In these cases, using Counter, which is backed
by a HashMap functor, will often not result in the expected space
savings, as hash tables will over-allocate to maintain an acceptable load
factor.
Trait Implementations§
Source§impl Clone for Enumerator
impl Clone for Enumerator
Source§fn clone(&self) -> Enumerator
fn clone(&self) -> Enumerator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Enumerator
impl Debug for Enumerator
Source§impl Default for Enumerator
impl Default for Enumerator
Source§fn default() -> Enumerator
fn default() -> Enumerator
Returns the “default value” for a type. Read more
Source§impl Hash for Enumerator
impl Hash for Enumerator
Source§impl PartialEq for Enumerator
impl PartialEq for Enumerator
Source§impl RandomStrategy for Enumerator
impl RandomStrategy for Enumerator
Source§fn fmap<A: Inner, B: Inner, F: Fn(A) -> B>(
f: Self::Functor<A>,
func: F,
) -> Self::Functor<B>
fn fmap<A: Inner, B: Inner, F: Fn(A) -> B>( f: Self::Functor<A>, func: F, ) -> Self::Functor<B>
Applies the given function to the functor’s inner.
Source§fn fmap_rand<A: Inner, B: Inner, R: RandomVariable, F: Fn(A, R) -> B>(
f: Self::Functor<A>,
_: &mut impl Rng,
func: F,
) -> Self::Functor<B>where
StandardUniform: Distribution<R>,
fn fmap_rand<A: Inner, B: Inner, R: RandomVariable, F: Fn(A, R) -> B>(
f: Self::Functor<A>,
_: &mut impl Rng,
func: F,
) -> Self::Functor<B>where
StandardUniform: Distribution<R>,
Using the strategy specified by the implementor, applies the given
binary function to the given functor and an element of the sample space
of a
RandomVariable. Read moreSource§fn fmap_rand_range<A: Inner, B: Inner, R: RandomVariable + SampleUniform, F: Fn(A, R) -> B>(
f: Self::Functor<A>,
range: impl RandomVariableRange<R>,
_: &mut impl Rng,
func: F,
) -> Self::Functor<B>where
StandardUniform: Distribution<R>,
fn fmap_rand_range<A: Inner, B: Inner, R: RandomVariable + SampleUniform, F: Fn(A, R) -> B>(
f: Self::Functor<A>,
range: impl RandomVariableRange<R>,
_: &mut impl Rng,
func: F,
) -> Self::Functor<B>where
StandardUniform: Distribution<R>,
Using the strategy specified by the implementor, applies the given
binary function to the given functor and an element of the sample space
of a
RandomVariableRange. Read moreimpl Copy for Enumerator
impl Eq for Enumerator
impl StructuralPartialEq for Enumerator
Auto Trait Implementations§
impl Freeze for Enumerator
impl RefUnwindSafe for Enumerator
impl Send for Enumerator
impl Sync for Enumerator
impl Unpin for Enumerator
impl UnwindSafe for Enumerator
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