Trait options_results::OptionIter
[−]
[src]
pub trait OptionIter: Iterator where Self: Sized, Self::Item: _OptionTrait {
fn unwrap(self) -> Unwrap<Self> { ... }
fn unwrap_or(self, def: Self::Item::Type) -> UnwrapOr<Self> { ... }
fn count_some(self) -> usize { ... }
fn find_some(&mut self) -> Option<Self::Item::Type> { ... }
fn has_some(&mut self) -> bool { ... }
fn has_none(&mut self) -> bool { ... }
fn some_iter(self) -> SomeIter<Self> { ... }
}Add some methods for the iterator of Option<T>.
Provided Methods
fn unwrap(self) -> Unwrap<Self>
Create an iterator which yields the unwrapped value as the next value.
(Unwrap<I>::next() will panic if the value is None.)
fn unwrap_or(self, def: Self::Item::Type) -> UnwrapOr<Self>
Create an iterator which yields the unwrapped value or a default as the next value.
fn count_some(self) -> usize
Count the number of Some(_) in this iterator.
fn find_some(&mut self) -> Option<Self::Item::Type>
Searches for an element of an iterator that the value is Some(_).
If each element of the iterator all equal None, it returns None.
fn has_some(&mut self) -> bool
Tests if any element of the iterator are Some(_).
fn has_none(&mut self) -> bool
Tests if any element of the iterator are None.
fn some_iter(self) -> SomeIter<Self>
Create an iterator which yields unwrapped Some(_) value.