[−][src]Trait gll_pg_core::StreamingIterator
Re-exported streaming_iterator
structs to avoid requiring dependency of generated code on it.
An interface for dealing with streaming iterators.
Associated Types
Loading content...Required methods
fn advance(&mut self)
Advances the iterator to the next element.
Iterators start just before the first element, so this should be called before get
.
The behavior of calling this method after the end of the iterator has been reached is unspecified.
fn get(&self) -> Option<&Self::Item>
Returns a reference to the current element of the iterator.
The behavior of calling this method before advance
has been called is unspecified.
Provided methods
fn next(&mut self) -> Option<&Self::Item>
Advances the iterator and returns the next value.
The behavior of calling this method after the end of the iterator has been reached is unspecified.
The default implementation simply calls advance
followed by get
.
fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator.
fn all<F>(&mut self, f: F) -> bool where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Determines if all elements of the iterator satisfy a predicate.
fn any<F>(&mut self, f: F) -> bool where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Determines if any elements of the iterator satisfy a predicate.
fn by_ref(&mut self) -> &mut Self
Borrows an iterator, rather than consuming it.
This is useful to allow the application of iterator adaptors while still retaining ownership of the original adaptor.
fn cloned(self) -> Cloned<Self> where
Self::Item: Clone,
Self::Item: Clone,
Produces a normal, non-streaming, iterator by cloning the elements of this iterator.
fn count(self) -> usize
Consumes the iterator, counting the number of remaining elements and returning it.
fn filter<F>(self, f: F) -> Filter<Self, F> where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Creates an iterator which uses a closure to determine if an element should be yielded.
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, B, F> where
F: FnMut(&Self::Item) -> Option<B>,
F: FnMut(&Self::Item) -> Option<B>,
Creates an iterator which both filters and maps by applying a closure to elements.
fn find<F>(&mut self, f: F) -> Option<&Self::Item> where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Returns the first element of the iterator that satisfies the predicate.
fn fuse(self) -> Fuse<Self>
Creates an iterator which is "well behaved" at the beginning and end of iteration.
The behavior of calling get
before iteration has been started, and of continuing to call
advance
after get
has returned None
is normally unspecified, but this guarantees that
get
will return None
in both cases.
fn map<B, F>(self, f: F) -> Map<Self, B, F> where
F: FnMut(&Self::Item) -> B,
F: FnMut(&Self::Item) -> B,
Creates an iterator which transforms elements of this iterator by passing them to a closure.
fn map_ref<B, F>(self, f: F) -> MapRef<Self, F> where
B: ?Sized,
F: Fn(&Self::Item) -> &B,
B: ?Sized,
F: Fn(&Self::Item) -> &B,
Creates an iterator which transforms elements of this iterator by passing them to a closure.
Unlike map
, this method takes a closure that returns a reference into the original value.
fn nth(&mut self, n: usize) -> Option<&Self::Item>
Consumes the first n
elements of the iterator, returning the next one.
fn position<F>(&mut self, f: F) -> Option<usize> where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Returns the index of the first element of the iterator matching a predicate.
fn skip(self, n: usize) -> Skip<Self>
Creates an iterator which skips the first n
elements.
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Creates an iterator that skips initial elements matching a predicate.
fn take(self, n: usize) -> Take<Self>
Creates an iterator which only returns the first n
elements.
fn take_while<F>(self, f: F) -> TakeWhile<Self, F> where
F: FnMut(&Self::Item) -> bool,
F: FnMut(&Self::Item) -> bool,
Creates an iterator which only returns initial elements matching a predicate.
fn rev(self) -> Rev<Self> where
Self: DoubleEndedStreamingIterator,
Self: DoubleEndedStreamingIterator,
Creates an iterator which returns elemens in the opposite order.
fn fold<B, F>(self, init: B, f: F) -> B where
F: FnMut(B, &Self::Item) -> B,
F: FnMut(B, &Self::Item) -> B,
Reduces the iterator's elements to a single, final value.
fn for_each<F>(self, f: F) where
F: FnMut(&Self::Item),
F: FnMut(&Self::Item),
Calls a closure on each element of an iterator.
Implementations on Foreign Types
impl<I> StreamingIterator for Empty<I>
[src]
type Item = I
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<Empty<I> as StreamingIterator>::Item>
[src]
impl<I> StreamingIterator for Fuse<I> where
I: StreamingIterator,
[src]
I: StreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn next(&mut self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn count(self) -> usize
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<Fuse<I> as StreamingIterator>::Item) -> Acc,
Fuse<I>: Sized,
[src]
Fold: FnMut(Acc, &<Fuse<I> as StreamingIterator>::Item) -> Acc,
Fuse<I>: Sized,
impl<I> StreamingIterator for Rev<I> where
I: DoubleEndedStreamingIterator,
[src]
I: DoubleEndedStreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn next(&mut self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn fold<Acc, Fold>(self, init: Acc, f: Fold) -> Acc where
Fold: FnMut(Acc, &<Rev<I> as StreamingIterator>::Item) -> Acc,
Rev<I>: Sized,
[src]
Fold: FnMut(Acc, &<Rev<I> as StreamingIterator>::Item) -> Acc,
Rev<I>: Sized,
impl<I, F> StreamingIterator for Filter<I, F> where
F: FnMut(&<I as StreamingIterator>::Item) -> bool,
I: StreamingIterator,
[src]
F: FnMut(&<I as StreamingIterator>::Item) -> bool,
I: StreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<Filter<I, F> as StreamingIterator>::Item) -> Acc,
Filter<I, F>: Sized,
[src]
Fold: FnMut(Acc, &<Filter<I, F> as StreamingIterator>::Item) -> Acc,
Filter<I, F>: Sized,
impl<'a, I, T> StreamingIterator for ConvertRef<'a, I, T> where
I: Iterator<Item = &'a T>,
T: ?Sized,
[src]
I: Iterator<Item = &'a T>,
T: ?Sized,
type Item = T
fn advance(&mut self)
[src]
fn get(&self) -> Option<&T>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn count(self) -> usize
[src]
fn fold<Acc, Fold>(self, init: Acc, f: Fold) -> Acc where
Fold: FnMut(Acc, &<ConvertRef<'a, I, T> as StreamingIterator>::Item) -> Acc,
ConvertRef<'a, I, T>: Sized,
[src]
Fold: FnMut(Acc, &<ConvertRef<'a, I, T> as StreamingIterator>::Item) -> Acc,
ConvertRef<'a, I, T>: Sized,
impl<I, B, F> StreamingIterator for FilterMap<I, B, F> where
F: FnMut(&<I as StreamingIterator>::Item) -> Option<B>,
I: StreamingIterator,
[src]
F: FnMut(&<I as StreamingIterator>::Item) -> Option<B>,
I: StreamingIterator,
type Item = B
fn advance(&mut self)
[src]
fn get(&self) -> Option<&B>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<FilterMap<I, B, F> as StreamingIterator>::Item) -> Acc,
FilterMap<I, B, F>: Sized,
[src]
Fold: FnMut(Acc, &<FilterMap<I, B, F> as StreamingIterator>::Item) -> Acc,
FilterMap<I, B, F>: Sized,
impl<'a, I> StreamingIterator for &'a mut I where
I: StreamingIterator + ?Sized,
[src]
I: StreamingIterator + ?Sized,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<&'a mut I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn next(&mut self) -> Option<&<&'a mut I as StreamingIterator>::Item>
[src]
impl<I> StreamingIterator for Skip<I> where
I: StreamingIterator,
[src]
I: StreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<Skip<I> as StreamingIterator>::Item) -> Acc,
Skip<I>: Sized,
[src]
Fold: FnMut(Acc, &<Skip<I> as StreamingIterator>::Item) -> Acc,
Skip<I>: Sized,
impl<I> StreamingIterator for Convert<I> where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as Iterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn count(self) -> usize
[src]
fn fold<Acc, Fold>(self, init: Acc, f: Fold) -> Acc where
Fold: FnMut(Acc, &<Convert<I> as StreamingIterator>::Item) -> Acc,
Convert<I>: Sized,
[src]
Fold: FnMut(Acc, &<Convert<I> as StreamingIterator>::Item) -> Acc,
Convert<I>: Sized,
impl<I> StreamingIterator for Take<I> where
I: StreamingIterator,
[src]
I: StreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
impl<I, F> StreamingIterator for SkipWhile<I, F> where
F: FnMut(&<I as StreamingIterator>::Item) -> bool,
I: StreamingIterator,
[src]
F: FnMut(&<I as StreamingIterator>::Item) -> bool,
I: StreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<SkipWhile<I, F> as StreamingIterator>::Item) -> Acc,
SkipWhile<I, F>: Sized,
[src]
Fold: FnMut(Acc, &<SkipWhile<I, F> as StreamingIterator>::Item) -> Acc,
SkipWhile<I, F>: Sized,
impl<I, F> StreamingIterator for TakeWhile<I, F> where
F: FnMut(&<I as StreamingIterator>::Item) -> bool,
I: StreamingIterator,
[src]
F: FnMut(&<I as StreamingIterator>::Item) -> bool,
I: StreamingIterator,
type Item = <I as StreamingIterator>::Item
fn advance(&mut self)
[src]
fn get(&self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn next(&mut self) -> Option<&<I as StreamingIterator>::Item>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
impl<I, B, F> StreamingIterator for Map<I, B, F> where
F: FnMut(&<I as StreamingIterator>::Item) -> B,
I: StreamingIterator,
[src]
F: FnMut(&<I as StreamingIterator>::Item) -> B,
I: StreamingIterator,
type Item = B
fn advance(&mut self)
[src]
fn get(&self) -> Option<&B>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<Map<I, B, F> as StreamingIterator>::Item) -> Acc,
Map<I, B, F>: Sized,
[src]
Fold: FnMut(Acc, &<Map<I, B, F> as StreamingIterator>::Item) -> Acc,
Map<I, B, F>: Sized,
impl<I, B, F> StreamingIterator for MapRef<I, F> where
B: ?Sized,
F: Fn(&<I as StreamingIterator>::Item) -> &B,
I: StreamingIterator,
[src]
B: ?Sized,
F: Fn(&<I as StreamingIterator>::Item) -> &B,
I: StreamingIterator,
type Item = B
fn advance(&mut self)
[src]
fn get(&self) -> Option<&B>
[src]
fn size_hint(&self) -> (usize, Option<usize>)
[src]
fn next(&mut self) -> Option<&B>
[src]
fn fold<Acc, Fold>(self, init: Acc, fold: Fold) -> Acc where
Fold: FnMut(Acc, &<MapRef<I, F> as StreamingIterator>::Item) -> Acc,
MapRef<I, F>: Sized,
[src]
Fold: FnMut(Acc, &<MapRef<I, F> as StreamingIterator>::Item) -> Acc,
MapRef<I, F>: Sized,