Struct reservoir_sampler::Reservoir [−][src]
pub struct Reservoir<T> { /* fields omitted */ }
Expand description
A Reservoir
is a just a pool, but for random number generation, total
items’ count passed through is known.
Implementations
Trait Implementations
impl<T> ReservoirSampler for Reservoir<T>
[src]
impl<T> ReservoirSampler for Reservoir<T>
[src]type Item = T
type Item = T
Each sampler only processes the same type of items.
fn sample(&mut self, it: Self::Item) -> (usize, usize, Option<Self::Item>)
[src]
fn sample(&mut self, it: Self::Item) -> (usize, usize, Option<Self::Item>)
[src]A sampler processes exactly one item each time, for the items come in as a stream. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Reservoir<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Reservoir<T> where
T: Send,
T: Send,
impl<T> Sync for Reservoir<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Reservoir<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Reservoir<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,