[][src]Struct qmc::sse::semi_classical::HashSampler

pub struct HashSampler<T: Hash + Eq + Copy> { /* fields omitted */ }

A HashSet with random sampling.

Implementations

impl<T: Hash + Eq + Copy> HashSampler<T>[src]

pub fn get_random<R: Rng>(&self, r: R) -> Option<T>[src]

Get a random entry from the HashSampler

pub fn pop_random<R: Rng>(&mut self, r: R) -> Option<T>[src]

Pop a random element.

pub fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool where
    T: Borrow<Q>,
    Q: Hash + Eq
[src]

Remove a given value.

pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool where
    T: Borrow<Q>,
    Q: Hash + Eq
[src]

Check if a given element has been inserted.

pub fn insert(&mut self, value: T) -> bool[src]

Insert an element.

pub fn clear(&mut self)[src]

Clear the hashset

pub fn len(&self) -> usize[src]

Get number of elements in set.

pub fn is_empty(&self) -> bool[src]

Check if empty.

Trait Implementations

impl<T: Clone + Hash + Eq + Copy> Clone for HashSampler<T>[src]

impl<T: Debug + Hash + Eq + Copy> Debug for HashSampler<T>[src]

impl<T: Default + Hash + Eq + Copy> Default for HashSampler<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for HashSampler<T> where
    T: RefUnwindSafe

impl<T> Send for HashSampler<T> where
    T: Send

impl<T> Sync for HashSampler<T> where
    T: Sync

impl<T> Unpin for HashSampler<T> where
    T: Unpin

impl<T> UnwindSafe for HashSampler<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,