Struct streaming_algorithms::SampleUnstable [−][src]
pub struct SampleUnstable<T> { /* fields omitted */ }Reservoir sampling. Without replacement, and the returned order is unstable.
Methods
impl<T> SampleUnstable<T>[src]
impl<T> SampleUnstable<T>pub fn new(samples: usize) -> Self[src]
pub fn new(samples: usize) -> SelfCreate a SampleUnstable that will provide a sample of size samples.
pub fn push<R: Rng>(&mut self, t: T, rng: &mut R)[src]
pub fn push<R: Rng>(&mut self, t: T, rng: &mut R)"Visit" this element
Trait Implementations
impl<T: Clone> Clone for SampleUnstable<T>[src]
impl<T: Clone> Clone for SampleUnstable<T>fn clone(&self) -> SampleUnstable<T>[src]
fn clone(&self) -> SampleUnstable<T>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl<T: Debug> Debug for SampleUnstable<T>[src]
impl<T: Debug> Debug for SampleUnstable<T>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<T> IntoIterator for SampleUnstable<T>[src]
impl<T> IntoIterator for SampleUnstable<T>type Item = T
The type of the elements being iterated over.
type IntoIter = IntoIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> IntoIter<T>[src]
fn into_iter(self) -> IntoIter<T>Creates an iterator from a value. Read more
impl<T> Sum for SampleUnstable<T>[src]
impl<T> Sum for SampleUnstable<T>fn sum<I>(iter: I) -> Self where
I: Iterator<Item = Self>, [src]
fn sum<I>(iter: I) -> Self where
I: Iterator<Item = Self>, Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more
impl<T> Add for SampleUnstable<T>[src]
impl<T> Add for SampleUnstable<T>type Output = Self
The resulting type after applying the + operator.
fn add(self, other: Self) -> Self[src]
fn add(self, other: Self) -> SelfPerforms the + operation.
impl<T> AddAssign for SampleUnstable<T>[src]
impl<T> AddAssign for SampleUnstable<T>fn add_assign(&mut self, other: Self)[src]
fn add_assign(&mut self, other: Self)Performs the += operation.
Auto Trait Implementations
impl<T> Send for SampleUnstable<T> where
T: Send,
impl<T> Send for SampleUnstable<T> where
T: Send, impl<T> Sync for SampleUnstable<T> where
T: Sync,
impl<T> Sync for SampleUnstable<T> where
T: Sync,