Struct rand_functors::UniqueEnumerator
source · pub struct UniqueEnumerator<S: BuildHasher + Default = RandomState> { /* private fields */ }
Expand description
Produces all possible outputs of the random process, without repetition,
stored in a HashSet
.
UniqueEnumerator
is optimal in scenarios where certain operations will map
many inputs to the same output and the user does not care about the relative
frequencies of possible outputs.
Trait Implementations§
source§impl<S: Clone + BuildHasher + Default> Clone for UniqueEnumerator<S>
impl<S: Clone + BuildHasher + Default> Clone for UniqueEnumerator<S>
source§fn clone(&self) -> UniqueEnumerator<S>
fn clone(&self) -> UniqueEnumerator<S>
Returns a copy 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<S: Debug + BuildHasher + Default> Debug for UniqueEnumerator<S>
impl<S: Debug + BuildHasher + Default> Debug for UniqueEnumerator<S>
source§impl<S: Default + BuildHasher + Default> Default for UniqueEnumerator<S>
impl<S: Default + BuildHasher + Default> Default for UniqueEnumerator<S>
source§fn default() -> UniqueEnumerator<S>
fn default() -> UniqueEnumerator<S>
Returns the “default value” for a type. Read more
source§impl<S: BuildHasher + Default> FlattenableRandomStrategy for UniqueEnumerator<S>
impl<S: BuildHasher + Default> FlattenableRandomStrategy for UniqueEnumerator<S>
source§impl<S: Hash + BuildHasher + Default> Hash for UniqueEnumerator<S>
impl<S: Hash + BuildHasher + Default> Hash for UniqueEnumerator<S>
source§impl<S: PartialEq + BuildHasher + Default> PartialEq for UniqueEnumerator<S>
impl<S: PartialEq + BuildHasher + Default> PartialEq for UniqueEnumerator<S>
source§fn eq(&self, other: &UniqueEnumerator<S>) -> bool
fn eq(&self, other: &UniqueEnumerator<S>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<S: BuildHasher + Default> RandomStrategy for UniqueEnumerator<S>
impl<S: BuildHasher + Default> RandomStrategy for UniqueEnumerator<S>
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
Standard: 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
Standard: 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
Standard: 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
Standard: 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<S: Copy + BuildHasher + Default> Copy for UniqueEnumerator<S>
impl<S: Eq + BuildHasher + Default> Eq for UniqueEnumerator<S>
impl<S: BuildHasher + Default> StructuralPartialEq for UniqueEnumerator<S>
Auto Trait Implementations§
impl<S> Freeze for UniqueEnumerator<S>
impl<S> RefUnwindSafe for UniqueEnumerator<S>where
S: RefUnwindSafe,
impl<S> Send for UniqueEnumerator<S>where
S: Send,
impl<S> Sync for UniqueEnumerator<S>where
S: Sync,
impl<S> Unpin for UniqueEnumerator<S>where
S: Unpin,
impl<S> UnwindSafe for UniqueEnumerator<S>where
S: UnwindSafe,
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