Struct skipping_search::CountingIntersection [−][src]
pub struct CountingIntersection<S> where
S: SkippingSearch, { /* fields omitted */ }
Combines an arbitrary number of SkippingSearch
objects,
and returns only the items present in at least target_count
of them.
Having target_count == sub_searches.len()
or target_count == 1
is valid but discouraged.
Instead use dedicated intersection/union constructs.
Methods
impl<S> CountingIntersection<S> where
S: SkippingSearch,
[src]
impl<S> CountingIntersection<S> where
S: SkippingSearch,
pub fn new(sub_searches: Vec<S>, target_count: usize) -> Self
[src]
pub fn new(sub_searches: Vec<S>, target_count: usize) -> Self
Assembles a counting-intersection out of other SkippingSearch
objects.
Panics
Will panic if sub_searches.len() < target_count
,
of if target_count == 0
.
Trait Implementations
impl<S> SkippingSearch for CountingIntersection<S> where
S: SkippingSearch,
[src]
impl<S> SkippingSearch for CountingIntersection<S> where
S: SkippingSearch,
type Item = S::Item
fn suggest_next(&self) -> Option<Self::Item>
[src]
fn suggest_next(&self) -> Option<Self::Item>
Returns the smallest value for which find_and_advance
may return true. For efficiency reasons, making sure the value is one for which find_and_advance
will return true is preferred, when possible. Read more
fn find_and_advance(&mut self, item: &Self::Item) -> bool
[src]
fn find_and_advance(&mut self, item: &Self::Item) -> bool
Returns whether this contains the passed-in value. Also mutates the receiver to forget about any values smaller than or equal to the item. Read more
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn size_hint(&self) -> (usize, Option<usize>)
Returns a lower/upper bound on the number of values that can be obtained by using self.find_and_advance(self.suggest_next())
repeatedly. (0, None)
is a valid, minimally constraining answer. (n, Some(n))
is a maximally constraining answer. Read more
Auto Trait Implementations
impl<S> Send for CountingIntersection<S> where
S: Send,
impl<S> Send for CountingIntersection<S> where
S: Send,
impl<S> Sync for CountingIntersection<S> where
S: Sync,
impl<S> Sync for CountingIntersection<S> where
S: Sync,