pub enum Either<L, R> {
Left(L),
Right(R),
}
Expand description
The enum Either
with variants Left
and Right
is a general purpose
sum type with two cases.
The Either
type is symmetric and treats its variants the same way, without
preference.
(For representing success or error, use the regular Result
enum instead.)
Variants
Left(L)
A value of type L
.
Right(R)
A value of type R
.
Implementations
sourceimpl<L, R> Either<L, R>
impl<L, R> Either<L, R>
sourcepub fn is_left(&self) -> bool
pub fn is_left(&self) -> bool
Return true if the value is the Left
variant.
use either::*;
let values = [Left(1), Right("the right value")];
assert_eq!(values[0].is_left(), true);
assert_eq!(values[1].is_left(), false);
sourcepub fn is_right(&self) -> bool
pub fn is_right(&self) -> bool
Return true if the value is the Right
variant.
use either::*;
let values = [Left(1), Right("the right value")];
assert_eq!(values[0].is_right(), false);
assert_eq!(values[1].is_right(), true);
sourcepub fn left(self) -> Option<L>
pub fn left(self) -> Option<L>
Convert the left side of Either<L, R>
to an Option<L>
.
use either::*;
let left: Either<_, ()> = Left("some value");
assert_eq!(left.left(), Some("some value"));
let right: Either<(), _> = Right(321);
assert_eq!(right.left(), None);
sourcepub fn right(self) -> Option<R>
pub fn right(self) -> Option<R>
Convert the right side of Either<L, R>
to an Option<R>
.
use either::*;
let left: Either<_, ()> = Left("some value");
assert_eq!(left.right(), None);
let right: Either<(), _> = Right(321);
assert_eq!(right.right(), Some(321));
sourcepub fn as_ref(&self) -> Either<&L, &R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
pub fn as_ref(&self) -> Either<&L, &R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Convert &Either<L, R>
to Either<&L, &R>
.
use either::*;
let left: Either<_, ()> = Left("some value");
assert_eq!(left.as_ref(), Left(&"some value"));
let right: Either<(), _> = Right("some value");
assert_eq!(right.as_ref(), Right(&"some value"));
sourcepub fn as_mut(&mut self) -> Either<&mut L, &mut R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
pub fn as_mut(&mut self) -> Either<&mut L, &mut R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Convert &mut Either<L, R>
to Either<&mut L, &mut R>
.
use either::*;
fn mutate_left(value: &mut Either<u32, u32>) {
if let Some(l) = value.as_mut().left() {
*l = 999;
}
}
let mut left = Left(123);
let mut right = Right(123);
mutate_left(&mut left);
mutate_left(&mut right);
assert_eq!(left, Left(999));
assert_eq!(right, Right(123));
sourcepub fn flip(self) -> Either<R, L>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
pub fn flip(self) -> Either<R, L>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Convert Either<L, R>
to Either<R, L>
.
use either::*;
let left: Either<_, ()> = Left(123);
assert_eq!(left.flip(), Right(123));
let right: Either<(), _> = Right("some value");
assert_eq!(right.flip(), Left("some value"));
sourcepub fn map_left<F, M>(self, f: F) -> Either<M, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(L) -> M,
pub fn map_left<F, M>(self, f: F) -> Either<M, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(L) -> M,
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Apply the function f
on the value in the Left
variant if it is present rewrapping the
result in Left
.
use either::*;
let left: Either<_, u32> = Left(123);
assert_eq!(left.map_left(|x| x * 2), Left(246));
let right: Either<u32, _> = Right(123);
assert_eq!(right.map_left(|x| x * 2), Right(123));
sourcepub fn map_right<F, S>(self, f: F) -> Either<L, S>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(R) -> S,
pub fn map_right<F, S>(self, f: F) -> Either<L, S>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(R) -> S,
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Apply the function f
on the value in the Right
variant if it is present rewrapping the
result in Right
.
use either::*;
let left: Either<_, u32> = Left(123);
assert_eq!(left.map_right(|x| x * 2), Left(123));
let right: Either<u32, _> = Right(123);
assert_eq!(right.map_right(|x| x * 2), Right(246));
sourcepub fn either<F, G, T>(self, f: F, g: G) -> T where
F: FnOnce(L) -> T,
G: FnOnce(R) -> T,
pub fn either<F, G, T>(self, f: F, g: G) -> T where
F: FnOnce(L) -> T,
G: FnOnce(R) -> T,
Apply one of two functions depending on contents, unifying their result. If the value is
Left(L)
then the first function f
is applied; if it is Right(R)
then the second
function g
is applied.
use either::*;
fn square(n: u32) -> i32 { (n * n) as i32 }
fn negate(n: i32) -> i32 { -n }
let left: Either<u32, i32> = Left(4);
assert_eq!(left.either(square, negate), 16);
let right: Either<u32, i32> = Right(-4);
assert_eq!(right.either(square, negate), 4);
sourcepub fn either_with<Ctx, F, G, T>(self, ctx: Ctx, f: F, g: G) -> T where
F: FnOnce(Ctx, L) -> T,
G: FnOnce(Ctx, R) -> T,
pub fn either_with<Ctx, F, G, T>(self, ctx: Ctx, f: F, g: G) -> T where
F: FnOnce(Ctx, L) -> T,
G: FnOnce(Ctx, R) -> T,
Like either
, but provide some context to whichever of the
functions ends up being called.
// In this example, the context is a mutable reference
use either::*;
let mut result = Vec::new();
let values = vec![Left(2), Right(2.7)];
for value in values {
value.either_with(&mut result,
|ctx, integer| ctx.push(integer),
|ctx, real| ctx.push(f64::round(real) as i32));
}
assert_eq!(result, vec![2, 3]);
sourcepub fn left_and_then<F, S>(self, f: F) -> Either<S, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(L) -> Either<S, R>,
pub fn left_and_then<F, S>(self, f: F) -> Either<S, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(L) -> Either<S, R>,
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Apply the function f
on the value in the Left
variant if it is present.
use either::*;
let left: Either<_, u32> = Left(123);
assert_eq!(left.left_and_then::<_,()>(|x| Right(x * 2)), Right(246));
let right: Either<u32, _> = Right(123);
assert_eq!(right.left_and_then(|x| Right::<(), _>(x * 2)), Right(123));
sourcepub fn right_and_then<F, S>(self, f: F) -> Either<L, S>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(R) -> Either<L, S>,
pub fn right_and_then<F, S>(self, f: F) -> Either<L, S>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(R) -> Either<L, S>,
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Apply the function f
on the value in the Right
variant if it is present.
use either::*;
let left: Either<_, u32> = Left(123);
assert_eq!(left.right_and_then(|x| Right(x * 2)), Left(123));
let right: Either<u32, _> = Right(123);
assert_eq!(right.right_and_then(|x| Right(x * 2)), Right(246));
sourcepub fn into_iter(
self
) -> Either<<L as IntoIterator>::IntoIter, <R as IntoIterator>::IntoIter>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
L: IntoIterator,
R: IntoIterator<Item = <L as IntoIterator>::Item>,
pub fn into_iter(
self
) -> Either<<L as IntoIterator>::IntoIter, <R as IntoIterator>::IntoIter>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
L: IntoIterator,
R: IntoIterator<Item = <L as IntoIterator>::Item>,
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Convert the inner value to an iterator.
use either::*;
let left: Either<_, Vec<u32>> = Left(vec![1, 2, 3, 4, 5]);
let mut right: Either<Vec<u32>, _> = Right(vec![]);
right.extend(left.into_iter());
assert_eq!(right, Right(vec![1, 2, 3, 4, 5]));
sourcepub fn left_or(self, other: L) -> L
pub fn left_or(self, other: L) -> L
Return left value or given value
Arguments passed to left_or
are eagerly evaluated; if you are passing
the result of a function call, it is recommended to use left_or_else
,
which is lazily evaluated.
Examples
let left: Either<&str, &str> = Left("left");
assert_eq!(left.left_or("foo"), "left");
let right: Either<&str, &str> = Right("right");
assert_eq!(right.left_or("left"), "left");
sourcepub fn left_or_default(self) -> L where
L: Default,
pub fn left_or_default(self) -> L where
L: Default,
Return left or a default
Examples
let left: Either<String, u32> = Left("left".to_string());
assert_eq!(left.left_or_default(), "left");
let right: Either<String, u32> = Right(42);
assert_eq!(right.left_or_default(), String::default());
sourcepub fn left_or_else<F>(self, f: F) -> L where
F: FnOnce(R) -> L,
pub fn left_or_else<F>(self, f: F) -> L where
F: FnOnce(R) -> L,
Returns left value or computes it from a closure
Examples
let left: Either<String, u32> = Left("3".to_string());
assert_eq!(left.left_or_else(|_| unreachable!()), "3");
let right: Either<String, u32> = Right(3);
assert_eq!(right.left_or_else(|x| x.to_string()), "3");
sourcepub fn right_or(self, other: R) -> R
pub fn right_or(self, other: R) -> R
Return right value or given value
Arguments passed to right_or
are eagerly evaluated; if you are passing
the result of a function call, it is recommended to use right_or_else
,
which is lazily evaluated.
Examples
let right: Either<&str, &str> = Right("right");
assert_eq!(right.right_or("foo"), "right");
let left: Either<&str, &str> = Left("left");
assert_eq!(left.right_or("right"), "right");
sourcepub fn right_or_default(self) -> R where
R: Default,
pub fn right_or_default(self) -> R where
R: Default,
Return right or a default
Examples
let left: Either<String, u32> = Left("left".to_string());
assert_eq!(left.right_or_default(), u32::default());
let right: Either<String, u32> = Right(42);
assert_eq!(right.right_or_default(), 42);
sourcepub fn right_or_else<F>(self, f: F) -> R where
F: FnOnce(L) -> R,
pub fn right_or_else<F>(self, f: F) -> R where
F: FnOnce(L) -> R,
Returns right value or computes it from a closure
Examples
let left: Either<String, u32> = Left("3".to_string());
assert_eq!(left.right_or_else(|x| x.parse().unwrap()), 3);
let right: Either<String, u32> = Right(3);
assert_eq!(right.right_or_else(|_| unreachable!()), 3);
sourcepub fn unwrap_left(self) -> L where
R: Debug,
pub fn unwrap_left(self) -> L where
R: Debug,
sourcepub fn unwrap_right(self) -> R where
L: Debug,
pub fn unwrap_right(self) -> R where
L: Debug,
sourcepub fn expect_left(self, msg: &str) -> L where
R: Debug,
pub fn expect_left(self, msg: &str) -> L where
R: Debug,
sourceimpl<T, L, R> Either<(T, L), (T, R)>
impl<T, L, R> Either<(T, L), (T, R)>
sourcepub fn factor_first(self) -> (T, Either<L, R>)
pub fn factor_first(self) -> (T, Either<L, R>)
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the first element of the pairs.
use either::*;
let left: Either<_, (u32, String)> = Left((123, vec![0]));
assert_eq!(left.factor_first().0, 123);
let right: Either<(u32, Vec<u8>), _> = Right((123, String::new()));
assert_eq!(right.factor_first().0, 123);
sourceimpl<T, L, R> Either<(L, T), (R, T)>
impl<T, L, R> Either<(L, T), (R, T)>
sourcepub fn factor_second(self) -> (Either<L, R>, T)
pub fn factor_second(self) -> (Either<L, R>, T)
Factor out a homogeneous type from an either of pairs.
Here, the homogeneous type is the second element of the pairs.
use either::*;
let left: Either<_, (String, u32)> = Left((vec![0], 123));
assert_eq!(left.factor_second().1, 123);
let right: Either<(Vec<u8>, u32), _> = Right((String::new(), 123));
assert_eq!(right.factor_second().1, 123);
sourceimpl<T> Either<T, T>
impl<T> Either<T, T>
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Extract the value of an either over two equivalent types.
use either::*;
let left: Either<_, u32> = Left(123);
assert_eq!(left.into_inner(), 123);
let right: Either<u32, _> = Right(123);
assert_eq!(right.into_inner(), 123);
sourcepub fn map<F, M>(self, f: F) -> Either<M, M>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(T) -> M,
pub fn map<F, M>(self, f: F) -> Either<M, M>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
where
F: FnOnce(T) -> M,
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Map f
over the contained value and return the result in the
corresponding variant.
use either::*;
let value: Either<_, i32> = Right(42);
let other = value.map(|x| x * 2);
assert_eq!(other, Right(84));
Trait Implementations
sourceimpl<L, R, Target> AsMut<[Target]> for Either<L, R> where
L: AsMut<[Target]>,
R: AsMut<[Target]>,
impl<L, R, Target> AsMut<[Target]> for Either<L, R> where
L: AsMut<[Target]>,
R: AsMut<[Target]>,
sourceimpl<L, R> AsMut<CStr> for Either<L, R> where
L: AsMut<CStr>,
R: AsMut<CStr>,
impl<L, R> AsMut<CStr> for Either<L, R> where
L: AsMut<CStr>,
R: AsMut<CStr>,
Requires crate feature use_std
.
sourceimpl<L, R> AsMut<OsStr> for Either<L, R> where
L: AsMut<OsStr>,
R: AsMut<OsStr>,
impl<L, R> AsMut<OsStr> for Either<L, R> where
L: AsMut<OsStr>,
R: AsMut<OsStr>,
Requires crate feature use_std
.
sourceimpl<L, R> AsMut<Path> for Either<L, R> where
L: AsMut<Path>,
R: AsMut<Path>,
impl<L, R> AsMut<Path> for Either<L, R> where
L: AsMut<Path>,
R: AsMut<Path>,
Requires crate feature use_std
.
sourceimpl<L, R, Target> AsRef<[Target]> for Either<L, R> where
L: AsRef<[Target]>,
R: AsRef<[Target]>,
impl<L, R, Target> AsRef<[Target]> for Either<L, R> where
L: AsRef<[Target]>,
R: AsRef<[Target]>,
sourceimpl<L, R> AsRef<CStr> for Either<L, R> where
L: AsRef<CStr>,
R: AsRef<CStr>,
impl<L, R> AsRef<CStr> for Either<L, R> where
L: AsRef<CStr>,
R: AsRef<CStr>,
Requires crate feature use_std
.
sourceimpl<L, R> AsRef<OsStr> for Either<L, R> where
L: AsRef<OsStr>,
R: AsRef<OsStr>,
impl<L, R> AsRef<OsStr> for Either<L, R> where
L: AsRef<OsStr>,
R: AsRef<OsStr>,
Requires crate feature use_std
.
sourceimpl<L, R> AsRef<Path> for Either<L, R> where
L: AsRef<Path>,
R: AsRef<Path>,
impl<L, R> AsRef<Path> for Either<L, R> where
L: AsRef<Path>,
R: AsRef<Path>,
Requires crate feature use_std
.
sourceimpl<L, R> BufRead for Either<L, R> where
L: BufRead,
R: BufRead,
impl<L, R> BufRead for Either<L, R> where
L: BufRead,
R: BufRead,
Requires crate feature "use_std"
sourcefn fill_buf(&mut self) -> Result<&[u8], Error>
fn fill_buf(&mut self) -> Result<&[u8], Error>
Returns the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more
sourcefn consume(&mut self, amt: usize)
fn consume(&mut self, amt: usize)
Tells this buffer that amt
bytes have been consumed from the buffer,
so they should no longer be returned in calls to read
. Read more
sourcefn has_data_left(&mut self) -> Result<bool, Error>
fn has_data_left(&mut self) -> Result<bool, Error>
buf_read_has_data_left
)Check if the underlying Read
has any data left to be read. Read more
1.0.0 · sourcefn read_until(
&mut self,
byte: u8,
buf: &mut Vec<u8, Global>
) -> Result<usize, Error>
fn read_until(
&mut self,
byte: u8,
buf: &mut Vec<u8, Global>
) -> Result<usize, Error>
Read all bytes into buf
until the delimiter byte
or EOF is reached. Read more
1.0.0 · sourcefn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_line(&mut self, buf: &mut String) -> Result<usize, Error>
Read all bytes until a newline (the 0xA
byte) is reached, and append
them to the provided buffer. You do not need to clear the buffer before
appending. Read more
sourceimpl<L, R> Clone for Either<L, R> where
L: Clone,
R: Clone,
impl<L, R> Clone for Either<L, R> where
L: Clone,
R: Clone,
sourcefn clone(&self) -> Either<L, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
fn clone(&self) -> Either<L, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<L, R> Deref for Either<L, R> where
L: Deref,
R: Deref<Target = <L as Deref>::Target>,
impl<L, R> Deref for Either<L, R> where
L: Deref,
R: Deref<Target = <L as Deref>::Target>,
sourcefn deref(&self) -> &<Either<L, R> as Deref>::TargetⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
fn deref(&self) -> &<Either<L, R> as Deref>::TargetⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Dereferences the value.
sourceimpl<L, R> DerefMut for Either<L, R> where
L: DerefMut,
R: DerefMut<Target = <L as Deref>::Target>,
impl<L, R> DerefMut for Either<L, R> where
L: DerefMut,
R: DerefMut<Target = <L as Deref>::Target>,
sourcefn deref_mut(&mut self) -> &mut <Either<L, R> as Deref>::TargetⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
fn deref_mut(&mut self) -> &mut <Either<L, R> as Deref>::TargetⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Mutably dereferences the value.
sourceimpl<L, R> DoubleEndedIterator for Either<L, R> where
L: DoubleEndedIterator,
R: DoubleEndedIterator<Item = <L as Iterator>::Item>,
impl<L, R> DoubleEndedIterator for Either<L, R> where
L: DoubleEndedIterator,
R: DoubleEndedIterator<Item = <L as Iterator>::Item>,
sourcefn next_back(&mut self) -> Option<<Either<L, R> as Iterator>::Item>
fn next_back(&mut self) -> Option<<Either<L, R> as Iterator>::Item>
Removes and returns an element from the end of the iterator. Read more
sourcefn advance_back_by(&mut self, n: usize) -> Result<(), usize>
fn advance_back_by(&mut self, n: usize) -> Result<(), usize>
iter_advance_by
)Advances the iterator from the back by n
elements. Read more
1.37.0 · sourcefn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
Returns the n
th element from the end of the iterator. Read more
1.27.0 · sourcefn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B>,
fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R where
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B>,
This is the reverse version of Iterator::try_fold()
: it takes
elements starting from the back of the iterator. Read more
sourceimpl<L, R> Error for Either<L, R> where
L: Error,
R: Error,
impl<L, R> Error for Either<L, R> where
L: Error,
R: Error,
Either
implements Error
if both L
and R
implement it.
sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourcefn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
sourceimpl<L, R> ExactSizeIterator for Either<L, R> where
L: ExactSizeIterator,
R: ExactSizeIterator<Item = <L as Iterator>::Item>,
impl<L, R> ExactSizeIterator for Either<L, R> where
L: ExactSizeIterator,
R: ExactSizeIterator<Item = <L as Iterator>::Item>,
sourceimpl<L, R, A> Extend<A> for Either<L, R> where
L: Extend<A>,
R: Extend<A>,
impl<L, R, A> Extend<A> for Either<L, R> where
L: Extend<A>,
R: Extend<A>,
sourcefn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = A>,
fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = A>,
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl<L, R> From<Result<R, L>> for Either<L, R>
impl<L, R> From<Result<R, L>> for Either<L, R>
Convert from Result
to Either
with Ok => Right
and Err => Left
.
sourcefn from(r: Result<R, L>) -> Either<L, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
fn from(r: Result<R, L>) -> Either<L, R>ⓘNotable traits for Either<L, R>impl<L, R> Write for Either<L, R> where
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
L: Write,
R: Write, impl<L, R> Read for Either<L, R> where
L: Read,
R: Read, impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>, type Item = <L as Iterator>::Item;
Converts to this type from the input type.
sourceimpl<L, R> Into<Result<R, L>> for Either<L, R>
impl<L, R> Into<Result<R, L>> for Either<L, R>
Convert from Either
to Result
with Right => Ok
and Left => Err
.
sourceimpl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>,
impl<L, R> Iterator for Either<L, R> where
L: Iterator,
R: Iterator<Item = <L as Iterator>::Item>,
Either<L, R>
is an iterator if both L
and R
are iterators.
sourcefn next(&mut self) -> Option<<Either<L, R> as Iterator>::Item>
fn next(&mut self) -> Option<<Either<L, R> as Iterator>::Item>
Advances the iterator and returns the next value. Read more
sourcefn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator. Read more
sourcefn fold<Acc, G>(self, init: Acc, f: G) -> Acc where
G: FnMut(Acc, <Either<L, R> as Iterator>::Item) -> Acc,
fn fold<Acc, G>(self, init: Acc, f: G) -> Acc where
G: FnMut(Acc, <Either<L, R> as Iterator>::Item) -> Acc,
Folds every element into an accumulator by applying an operation, returning the final result. Read more
sourcefn count(self) -> usize
fn count(self) -> usize
Consumes the iterator, counting the number of iterations and returning it. Read more
sourcefn last(self) -> Option<<Either<L, R> as Iterator>::Item>
fn last(self) -> Option<<Either<L, R> as Iterator>::Item>
Consumes the iterator, returning the last element. Read more
sourcefn nth(&mut self, n: usize) -> Option<<Either<L, R> as Iterator>::Item>
fn nth(&mut self, n: usize) -> Option<<Either<L, R> as Iterator>::Item>
Returns the n
th element of the iterator. Read more
sourcefn collect<B>(self) -> B where
B: FromIterator<<Either<L, R> as Iterator>::Item>,
fn collect<B>(self) -> B where
B: FromIterator<<Either<L, R> as Iterator>::Item>,
Transforms an iterator into a collection. Read more
sourcefn all<F>(&mut self, f: F) -> bool where
F: FnMut(<Either<L, R> as Iterator>::Item) -> bool,
fn all<F>(&mut self, f: F) -> bool where
F: FnMut(<Either<L, R> as Iterator>::Item) -> bool,
Tests if every element of the iterator matches a predicate. Read more
sourcefn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
fn next_chunk<const N: usize>(
&mut self
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
iter_next_chunk
)Advances the iterator and returns an array containing the next N
values. Read more
sourcefn advance_by(&mut self, n: usize) -> Result<(), usize>
fn advance_by(&mut self, n: usize) -> Result<(), usize>
iter_advance_by
)Advances the iterator by n
elements. Read more
1.28.0 · sourcefn step_by(self, step: usize) -> StepBy<Self>
fn step_by(self, step: usize) -> StepBy<Self>
Creates an iterator starting at the same point, but stepping by the given amount at each iteration. Read more
1.0.0 · sourcefn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> where
U: IntoIterator<Item = Self::Item>,
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> where
U: IntoIterator<Item = Self::Item>,
Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · sourcefn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> where
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> where
U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs. Read more
sourcefn intersperse(self, separator: Self::Item) -> Intersperse<Self> where
Self::Item: Clone,
fn intersperse(self, separator: Self::Item) -> Intersperse<Self> where
Self::Item: Clone,
iter_intersperse
)Creates a new iterator which places a copy of separator
between adjacent
items of the original iterator. Read more
sourcefn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> where
G: FnMut() -> Self::Item,
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> where
G: FnMut() -> Self::Item,
iter_intersperse
)Creates a new iterator which places an item generated by separator
between adjacent items of the original iterator. Read more
1.0.0 · sourcefn map<B, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> B,
fn map<B, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> B,
Takes a closure and creates an iterator which calls that closure on each element. Read more
1.21.0 · sourcefn for_each<F>(self, f: F) where
F: FnMut(Self::Item),
fn for_each<F>(self, f: F) where
F: FnMut(Self::Item),
Calls a closure on each element of an iterator. Read more
1.0.0 · sourcefn filter<P>(self, predicate: P) -> Filter<Self, P> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn filter<P>(self, predicate: P) -> Filter<Self, P> where
P: for<'_> FnMut(&Self::Item) -> bool,
Creates an iterator which uses a closure to determine if an element should be yielded. Read more
1.0.0 · sourcefn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> where
F: FnMut(Self::Item) -> Option<B>,
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> where
F: FnMut(Self::Item) -> Option<B>,
Creates an iterator that both filters and maps. Read more
1.0.0 · sourcefn enumerate(self) -> Enumerate<Self>
fn enumerate(self) -> Enumerate<Self>
Creates an iterator which gives the current iteration count as well as the next value. Read more
1.0.0 · sourcefn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: for<'_> FnMut(&Self::Item) -> bool,
1.0.0 · sourcefn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: for<'_> FnMut(&Self::Item) -> bool,
Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · sourcefn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> where
P: FnMut(Self::Item) -> Option<B>,
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> where
P: FnMut(Self::Item) -> Option<B>,
Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · sourcefn skip(self, n: usize) -> Skip<Self>
fn skip(self, n: usize) -> Skip<Self>
Creates an iterator that skips the first n
elements. Read more
1.0.0 · sourcefn take(self, n: usize) -> Take<Self>
fn take(self, n: usize) -> Take<Self>
Creates an iterator that yields the first n
elements, or fewer
if the underlying iterator ends sooner. Read more
1.0.0 · sourcefn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> where
F: for<'_> FnMut(&mut St, Self::Item) -> Option<B>,
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> where
F: for<'_> FnMut(&mut St, Self::Item) -> Option<B>,
1.0.0 · sourcefn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
U: IntoIterator,
F: FnMut(Self::Item) -> U,
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
U: IntoIterator,
F: FnMut(Self::Item) -> U,
Creates an iterator that works like map, but flattens nested structure. Read more
1.29.0 · sourcefn flatten(self) -> Flatten<Self> where
Self::Item: IntoIterator,
fn flatten(self) -> Flatten<Self> where
Self::Item: IntoIterator,
Creates an iterator that flattens nested structure. Read more
1.0.0 · sourcefn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: for<'_> FnMut(&Self::Item),
fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: for<'_> FnMut(&Self::Item),
Does something with each element of an iterator, passing the value on. Read more
1.0.0 · sourcefn by_ref(&mut self) -> &mut Self
fn by_ref(&mut self) -> &mut Self
Borrows an iterator, rather than consuming it. Read more
sourcefn try_collect<B>(
&mut self
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType where
B: FromIterator<<Self::Item as Try>::Output>,
Self::Item: Try,
<Self::Item as Try>::Residual: Residual<B>,
fn try_collect<B>(
&mut self
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType where
B: FromIterator<<Self::Item as Try>::Output>,
Self::Item: Try,
<Self::Item as Try>::Residual: Residual<B>,
iterator_try_collect
)Fallibly transforms an iterator into a collection, short circuiting if a failure is encountered. Read more
sourcefn collect_into<E>(self, collection: &mut E) -> &mut E where
E: Extend<Self::Item>,
fn collect_into<E>(self, collection: &mut E) -> &mut E where
E: Extend<Self::Item>,
iter_collect_into
)Collects all the items from an iterator into a collection. Read more
1.0.0 · sourcefn partition<B, F>(self, f: F) -> (B, B) where
B: Default + Extend<Self::Item>,
F: for<'_> FnMut(&Self::Item) -> bool,
fn partition<B, F>(self, f: F) -> (B, B) where
B: Default + Extend<Self::Item>,
F: for<'_> FnMut(&Self::Item) -> bool,
Consumes an iterator, creating two collections from it. Read more
sourcefn partition_in_place<'a, T, P>(self, predicate: P) -> usize where
T: 'a,
Self: DoubleEndedIterator<Item = &'a mut T>,
P: for<'_> FnMut(&T) -> bool,
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize where
T: 'a,
Self: DoubleEndedIterator<Item = &'a mut T>,
P: for<'_> FnMut(&T) -> bool,
iter_partition_in_place
)Reorders the elements of this iterator in-place according to the given predicate,
such that all those that return true
precede all those that return false
.
Returns the number of true
elements found. Read more
sourcefn is_partitioned<P>(self, predicate: P) -> bool where
P: FnMut(Self::Item) -> bool,
fn is_partitioned<P>(self, predicate: P) -> bool where
P: FnMut(Self::Item) -> bool,
iter_is_partitioned
)Checks if the elements of this iterator are partitioned according to the given predicate,
such that all those that return true
precede all those that return false
. Read more
1.27.0 · sourcefn try_fold<B, F, R>(&mut self, init: B, f: F) -> R where
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B>,
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R where
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B>,
An iterator method that applies a function as long as it returns successfully, producing a single, final value. Read more
1.27.0 · sourcefn try_for_each<F, R>(&mut self, f: F) -> R where
F: FnMut(Self::Item) -> R,
R: Try<Output = ()>,
fn try_for_each<F, R>(&mut self, f: F) -> R where
F: FnMut(Self::Item) -> R,
R: Try<Output = ()>,
An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error. Read more
1.51.0 · sourcefn reduce<F>(self, f: F) -> Option<Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Self::Item,
fn reduce<F>(self, f: F) -> Option<Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Self::Item,
Reduces the elements to a single one, by repeatedly applying a reducing operation. Read more
sourcefn try_reduce<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType where
F: FnMut(Self::Item, Self::Item) -> R,
R: Try<Output = Self::Item>,
<R as Try>::Residual: Residual<Option<Self::Item>>,
fn try_reduce<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType where
F: FnMut(Self::Item, Self::Item) -> R,
R: Try<Output = Self::Item>,
<R as Try>::Residual: Residual<Option<Self::Item>>,
iterator_try_reduce
)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · sourcefn any<F>(&mut self, f: F) -> bool where
F: FnMut(Self::Item) -> bool,
fn any<F>(&mut self, f: F) -> bool where
F: FnMut(Self::Item) -> bool,
Tests if any element of the iterator matches a predicate. Read more
1.0.0 · sourcefn find<P>(&mut self, predicate: P) -> Option<Self::Item> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn find<P>(&mut self, predicate: P) -> Option<Self::Item> where
P: for<'_> FnMut(&Self::Item) -> bool,
Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · sourcefn find_map<B, F>(&mut self, f: F) -> Option<B> where
F: FnMut(Self::Item) -> Option<B>,
fn find_map<B, F>(&mut self, f: F) -> Option<B> where
F: FnMut(Self::Item) -> Option<B>,
Applies function to the elements of iterator and returns the first non-none result. Read more
sourcefn try_find<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType where
F: for<'_> FnMut(&Self::Item) -> R,
R: Try<Output = bool>,
<R as Try>::Residual: Residual<Option<Self::Item>>,
fn try_find<F, R>(
&mut self,
f: F
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType where
F: for<'_> FnMut(&Self::Item) -> R,
R: Try<Output = bool>,
<R as Try>::Residual: Residual<Option<Self::Item>>,
try_find
)Applies function to the elements of iterator and returns the first true result or the first error. Read more
1.0.0 · sourcefn position<P>(&mut self, predicate: P) -> Option<usize> where
P: FnMut(Self::Item) -> bool,
fn position<P>(&mut self, predicate: P) -> Option<usize> where
P: FnMut(Self::Item) -> bool,
Searches for an element in an iterator, returning its index. Read more
1.0.0 · sourcefn rposition<P>(&mut self, predicate: P) -> Option<usize> where
P: FnMut(Self::Item) -> bool,
Self: ExactSizeIterator + DoubleEndedIterator,
fn rposition<P>(&mut self, predicate: P) -> Option<usize> where
P: FnMut(Self::Item) -> bool,
Self: ExactSizeIterator + DoubleEndedIterator,
Searches for an element in an iterator from the right, returning its index. Read more
1.0.0 · sourcefn max(self) -> Option<Self::Item> where
Self::Item: Ord,
fn max(self) -> Option<Self::Item> where
Self::Item: Ord,
Returns the maximum element of an iterator. Read more
1.0.0 · sourcefn min(self) -> Option<Self::Item> where
Self::Item: Ord,
fn min(self) -> Option<Self::Item> where
Self::Item: Ord,
Returns the minimum element of an iterator. Read more
1.6.0 · sourcefn max_by_key<B, F>(self, f: F) -> Option<Self::Item> where
B: Ord,
F: for<'_> FnMut(&Self::Item) -> B,
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item> where
B: Ord,
F: for<'_> FnMut(&Self::Item) -> B,
Returns the element that gives the maximum value from the specified function. Read more
1.15.0 · sourcefn max_by<F>(self, compare: F) -> Option<Self::Item> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn max_by<F>(self, compare: F) -> Option<Self::Item> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Returns the element that gives the maximum value with respect to the specified comparison function. Read more
1.6.0 · sourcefn min_by_key<B, F>(self, f: F) -> Option<Self::Item> where
B: Ord,
F: for<'_> FnMut(&Self::Item) -> B,
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item> where
B: Ord,
F: for<'_> FnMut(&Self::Item) -> B,
Returns the element that gives the minimum value from the specified function. Read more
1.15.0 · sourcefn min_by<F>(self, compare: F) -> Option<Self::Item> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn min_by<F>(self, compare: F) -> Option<Self::Item> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Returns the element that gives the minimum value with respect to the specified comparison function. Read more
1.0.0 · sourcefn rev(self) -> Rev<Self> where
Self: DoubleEndedIterator,
fn rev(self) -> Rev<Self> where
Self: DoubleEndedIterator,
Reverses an iterator’s direction. Read more
1.0.0 · sourcefn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB) where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Iterator<Item = (A, B)>,
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB) where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Iterator<Item = (A, B)>,
Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · sourcefn copied<'a, T>(self) -> Copied<Self> where
T: 'a + Copy,
Self: Iterator<Item = &'a T>,
fn copied<'a, T>(self) -> Copied<Self> where
T: 'a + Copy,
Self: Iterator<Item = &'a T>,
Creates an iterator which copies all of its elements. Read more
1.0.0 · sourcefn cloned<'a, T>(self) -> Cloned<Self> where
T: 'a + Clone,
Self: Iterator<Item = &'a T>,
fn cloned<'a, T>(self) -> Cloned<Self> where
T: 'a + Clone,
Self: Iterator<Item = &'a T>,
1.0.0 · sourcefn cycle(self) -> Cycle<Self> where
Self: Clone,
fn cycle(self) -> Cycle<Self> where
Self: Clone,
Repeats an iterator endlessly. Read more
1.11.0 · sourcefn sum<S>(self) -> S where
S: Sum<Self::Item>,
fn sum<S>(self) -> S where
S: Sum<Self::Item>,
Sums the elements of an iterator. Read more
1.11.0 · sourcefn product<P>(self) -> P where
P: Product<Self::Item>,
fn product<P>(self) -> P where
P: Product<Self::Item>,
Iterates over the entire iterator, multiplying all the elements Read more
1.5.0 · sourcefn cmp<I>(self, other: I) -> Ordering where
I: IntoIterator<Item = Self::Item>,
Self::Item: Ord,
fn cmp<I>(self, other: I) -> Ordering where
I: IntoIterator<Item = Self::Item>,
Self::Item: Ord,
Lexicographically compares the elements of this Iterator
with those
of another. Read more
sourcefn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering where
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering where
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,
iter_order_by
)Lexicographically compares the elements of this Iterator
with those
of another with respect to the specified comparison function. Read more
1.5.0 · sourcefn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
fn partial_cmp<I>(self, other: I) -> Option<Ordering> where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Lexicographically compares the elements of this Iterator
with those
of another. Read more
sourcefn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering> where
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering> where
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by
)Lexicographically compares the elements of this Iterator
with those
of another with respect to the specified comparison function. Read more
1.5.0 · sourcefn eq<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
fn eq<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
sourcefn eq_by<I, F>(self, other: I, eq: F) -> bool where
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
fn eq_by<I, F>(self, other: I, eq: F) -> bool where
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,
iter_order_by
)1.5.0 · sourcefn ne<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
fn ne<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
1.5.0 · sourcefn lt<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
fn lt<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Determines if the elements of this Iterator
are lexicographically
less than those of another. Read more
1.5.0 · sourcefn le<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
fn le<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Determines if the elements of this Iterator
are lexicographically
less or equal to those of another. Read more
1.5.0 · sourcefn gt<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
fn gt<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Determines if the elements of this Iterator
are lexicographically
greater than those of another. Read more
1.5.0 · sourcefn ge<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
fn ge<I>(self, other: I) -> bool where
I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Determines if the elements of this Iterator
are lexicographically
greater than or equal to those of another. Read more
sourcefn is_sorted(self) -> bool where
Self::Item: PartialOrd<Self::Item>,
fn is_sorted(self) -> bool where
Self::Item: PartialOrd<Self::Item>,
is_sorted
)Checks if the elements of this iterator are sorted. Read more
sourcefn is_sorted_by<F>(self, compare: F) -> bool where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,
fn is_sorted_by<F>(self, compare: F) -> bool where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,
is_sorted
)Checks if the elements of this iterator are sorted using the given comparator function. Read more
sourcefn is_sorted_by_key<F, K>(self, f: F) -> bool where
F: FnMut(Self::Item) -> K,
K: PartialOrd<K>,
fn is_sorted_by_key<F, K>(self, f: F) -> bool where
F: FnMut(Self::Item) -> K,
K: PartialOrd<K>,
is_sorted
)Checks if the elements of this iterator are sorted using the given key extraction function. Read more
sourceimpl<L, R> Ord for Either<L, R> where
L: Ord,
R: Ord,
impl<L, R> Ord for Either<L, R> where
L: Ord,
R: Ord,
sourceimpl<L, R> PartialOrd<Either<L, R>> for Either<L, R> where
L: PartialOrd<L>,
R: PartialOrd<R>,
impl<L, R> PartialOrd<Either<L, R>> for Either<L, R> where
L: PartialOrd<L>,
R: PartialOrd<R>,
sourcefn partial_cmp(&self, other: &Either<L, R>) -> Option<Ordering>
fn partial_cmp(&self, other: &Either<L, R>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<L, R> Read for Either<L, R> where
L: Read,
R: Read,
impl<L, R> Read for Either<L, R> where
L: Read,
R: Read,
Either<L, R>
implements Read
if both L
and R
do.
Requires crate feature "use_std"
sourcefn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Error>
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
sourcefn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
Read all bytes until EOF in this source, placing them into buf
. Read more
1.36.0 · sourcefn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
Like read
, except that it reads into a slice of buffers. Read more
sourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
1.0.0 · sourcefn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
Read all bytes until EOF in this source, appending them to buf
. Read more
1.6.0 · sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
Read the exact number of bytes required to fill buf
. Read more
sourcefn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Pull some bytes from this source into the specified buffer. Read more
sourcefn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, buf: &mut ReadBuf<'_>) -> Result<(), Error>
read_buf
)Read the exact number of bytes required to fill buf
. Read more
1.0.0 · sourcefn by_ref(&mut self) -> &mut Self
fn by_ref(&mut self) -> &mut Self
Creates a “by reference” adaptor for this instance of Read
. Read more
sourceimpl<L, R> Write for Either<L, R> where
L: Write,
R: Write,
impl<L, R> Write for Either<L, R> where
L: Write,
R: Write,
Either<L, R>
implements Write
if both L
and R
do.
Requires crate feature "use_std"
sourcefn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
impl<L, R> Copy for Either<L, R> where
L: Copy,
R: Copy,
impl<L, R> Eq for Either<L, R> where
L: Eq,
R: Eq,
impl<L, R> StructuralEq for Either<L, R>
impl<L, R> StructuralPartialEq for Either<L, R>
Auto Trait Implementations
impl<L, R> RefUnwindSafe for Either<L, R> where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for Either<L, R> where
L: Send,
R: Send,
impl<L, R> Sync for Either<L, R> where
L: Sync,
R: Sync,
impl<L, R> Unpin for Either<L, R> where
L: Unpin,
R: Unpin,
impl<L, R> UnwindSafe for Either<L, R> where
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<I> IntoIterator for I where
I: Iterator,
impl<I> IntoIterator for I where
I: Iterator,
sourceimpl<I> IteratorRandom for I where
I: Iterator,
impl<I> IteratorRandom for I where
I: Iterator,
sourcefn choose<R>(self, rng: &mut R) -> Option<Self::Item> where
R: Rng + ?Sized,
fn choose<R>(self, rng: &mut R) -> Option<Self::Item> where
R: Rng + ?Sized,
Choose one element at random from the iterator. Read more
sourcefn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item> where
R: Rng + ?Sized,
fn choose_stable<R>(self, rng: &mut R) -> Option<Self::Item> where
R: Rng + ?Sized,
Choose one element at random from the iterator. Read more
sourceimpl<T> Itertools for T where
T: Iterator + ?Sized,
impl<T> Itertools for T where
T: Iterator + ?Sized,
sourcefn interleave<J>(
self,
other: J
) -> Interleave<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator<Item = Self::Item>,
fn interleave<J>(
self,
other: J
) -> Interleave<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator<Item = Self::Item>,
Alternate elements from two iterators until both have run out. Read more
sourcefn interleave_shortest<J>(
self,
other: J
) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator<Item = Self::Item>,
fn interleave_shortest<J>(
self,
other: J
) -> InterleaveShortest<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator<Item = Self::Item>,
Alternate elements from two iterators until at least one of them has run out. Read more
sourcefn intersperse(
self,
element: Self::Item
) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>> where
Self::Item: Clone,
fn intersperse(
self,
element: Self::Item
) -> IntersperseWith<Self, IntersperseElementSimple<Self::Item>> where
Self::Item: Clone,
An iterator adaptor to insert a particular value between each element of the adapted iterator. Read more
sourcefn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F> where
F: FnMut() -> Self::Item,
fn intersperse_with<F>(self, element: F) -> IntersperseWith<Self, F> where
F: FnMut() -> Self::Item,
An iterator adaptor to insert a particular value created by a function between each element of the adapted iterator. Read more
sourcefn zip_longest<J>(
self,
other: J
) -> ZipLongest<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator,
fn zip_longest<J>(
self,
other: J
) -> ZipLongest<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator,
Create an iterator which iterates over both this and the specified iterator simultaneously, yielding pairs of two optional elements. Read more
sourcefn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator,
fn zip_eq<J>(self, other: J) -> ZipEq<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator,
Create an iterator which iterates over both this and the specified iterator simultaneously, yielding pairs of elements. Read more
sourcefn batching<B, F>(self, f: F) -> Batching<Self, F> where
F: for<'_> FnMut(&mut Self) -> Option<B>,
fn batching<B, F>(self, f: F) -> Batching<Self, F> where
F: for<'_> FnMut(&mut Self) -> Option<B>,
A “meta iterator adaptor”. Its closure receives a reference to the iterator and may pick off as many elements as it likes, to produce the next iterator element. Read more
sourcefn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F> where
F: for<'_> FnMut(&Self::Item) -> K,
K: PartialEq<K>,
fn group_by<K, F>(self, key: F) -> GroupBy<K, Self, F> where
F: for<'_> FnMut(&Self::Item) -> K,
K: PartialEq<K>,
Return an iterable that can group iterator elements. Consecutive elements that map to the same key (“runs”), are assigned to the same group. Read more
sourcefn chunks(self, size: usize) -> IntoChunks<Self>
fn chunks(self, size: usize) -> IntoChunks<Self>
Return an iterable that can chunk the iterator. Read more
sourcefn tuple_windows<T>(self) -> TupleWindows<Self, T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
<T as TupleCollect>::Item: Clone,
fn tuple_windows<T>(self) -> TupleWindows<Self, T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
<T as TupleCollect>::Item: Clone,
Return an iterator over all contiguous windows producing tuples of a specific size (up to 12). Read more
sourcefn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T> where
Self: Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator,
T: TupleCollect + Clone,
<T as TupleCollect>::Item: Clone,
fn circular_tuple_windows<T>(self) -> CircularTupleWindows<Self, T> where
Self: Clone + Iterator<Item = <T as TupleCollect>::Item> + ExactSizeIterator,
T: TupleCollect + Clone,
<T as TupleCollect>::Item: Clone,
Return an iterator over all windows, wrapping back to the first elements when the window would otherwise exceed the length of the iterator, producing tuples of a specific size (up to 12). Read more
sourcefn tuples<T>(self) -> Tuples<Self, T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
fn tuples<T>(self) -> Tuples<Self, T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
Return an iterator that groups the items in tuples of a specific size (up to 12). Read more
sourcefn tee(self) -> (Tee<Self>, Tee<Self>) where
Self::Item: Clone,
fn tee(self) -> (Tee<Self>, Tee<Self>) where
Self::Item: Clone,
Split into an iterator pair that both yield all elements from the original iterator. Read more
sourcefn step(self, n: usize) -> Step<Self>
fn step(self, n: usize) -> Step<Self>
Use std .step_by() instead
Return an iterator adaptor that steps n
elements in the base iterator
for each iteration. Read more
sourcefn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>> where
Self::Item: Into<R>,
fn map_into<R>(self) -> MapSpecialCase<Self, MapSpecialCaseFnInto<R>> where
Self::Item: Into<R>,
sourcefn map_results<F, T, U, E>(
self,
f: F
) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>> where
Self: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> U,
fn map_results<F, T, U, E>(
self,
f: F
) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>> where
Self: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> U,
Use .map_ok() instead
See .map_ok()
.
sourcefn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>> where
Self: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> U,
fn map_ok<F, T, U, E>(self, f: F) -> MapSpecialCase<Self, MapSpecialCaseFnOk<F>> where
Self: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> U,
Return an iterator adaptor that applies the provided closure
to every Result::Ok
value. Result::Err
values are
unchanged. Read more
sourcefn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F> where
Self: Iterator<Item = Result<T, E>>,
F: for<'_> FnMut(&T) -> bool,
fn filter_ok<F, T, E>(self, f: F) -> FilterOk<Self, F> where
Self: Iterator<Item = Result<T, E>>,
F: for<'_> FnMut(&T) -> bool,
Return an iterator adaptor that filters every Result::Ok
value with the provided closure. Result::Err
values are
unchanged. Read more
sourcefn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F> where
Self: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Option<U>,
fn filter_map_ok<F, T, U, E>(self, f: F) -> FilterMapOk<Self, F> where
Self: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Option<U>,
Return an iterator adaptor that filters and transforms every
Result::Ok
value with the provided closure. Result::Err
values are unchanged. Read more
sourcefn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E> where
Self: Iterator<Item = Result<T, E>>,
T: IntoIterator,
fn flatten_ok<T, E>(self) -> FlattenOk<Self, T, E> where
Self: Iterator<Item = Result<T, E>>,
T: IntoIterator,
Return an iterator adaptor that flattens every Result::Ok
value into
a series of Result::Ok
values. Result::Err
values are unchanged. Read more
sourcefn merge<J>(
self,
other: J
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte> where
J: IntoIterator<Item = Self::Item>,
Self::Item: PartialOrd<Self::Item>,
fn merge<J>(
self,
other: J
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, MergeLte> where
J: IntoIterator<Item = Self::Item>,
Self::Item: PartialOrd<Self::Item>,
Return an iterator adaptor that merges the two base iterators in ascending order. If both base iterators are sorted (ascending), the result is sorted. Read more
sourcefn merge_by<J, F>(
self,
other: J,
is_first: F
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F> where
J: IntoIterator<Item = Self::Item>,
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> bool,
fn merge_by<J, F>(
self,
other: J,
is_first: F
) -> MergeBy<Self, <J as IntoIterator>::IntoIter, F> where
J: IntoIterator<Item = Self::Item>,
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> bool,
sourcefn merge_join_by<J, F>(
self,
other: J,
cmp_fn: F
) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F> where
J: IntoIterator,
F: for<'_, '_> FnMut(&Self::Item, &<J as IntoIterator>::Item) -> Ordering,
fn merge_join_by<J, F>(
self,
other: J,
cmp_fn: F
) -> MergeJoinBy<Self, <J as IntoIterator>::IntoIter, F> where
J: IntoIterator,
F: for<'_, '_> FnMut(&Self::Item, &<J as IntoIterator>::Item) -> Ordering,
Create an iterator that merges items from both this and the specified iterator in ascending order. Read more
sourcefn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt> where
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::Item: PartialOrd<<Self::Item as IntoIterator>::Item>,
fn kmerge(self) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, KMergeByLt> where
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::Item: PartialOrd<<Self::Item as IntoIterator>::Item>,
Return an iterator adaptor that flattens an iterator of iterators by merging them in ascending order. Read more
sourcefn kmerge_by<F>(
self,
first: F
) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F> where
F: for<'_, '_> FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,
Self::Item: IntoIterator,
fn kmerge_by<F>(
self,
first: F
) -> KMergeBy<<Self::Item as IntoIterator>::IntoIter, F> where
F: for<'_, '_> FnMut(&<Self::Item as IntoIterator>::Item, &<Self::Item as IntoIterator>::Item) -> bool,
Self::Item: IntoIterator,
Return an iterator adaptor that flattens an iterator of iterators by merging them according to the given closure. Read more
sourcefn cartesian_product<J>(
self,
other: J
) -> Product<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator,
Self::Item: Clone,
<J as IntoIterator>::IntoIter: Clone,
fn cartesian_product<J>(
self,
other: J
) -> Product<Self, <J as IntoIterator>::IntoIter> where
J: IntoIterator,
Self::Item: Clone,
<J as IntoIterator>::IntoIter: Clone,
Return an iterator adaptor that iterates over the cartesian product of
the element sets of two iterators self
and J
. Read more
sourcefn multi_cartesian_product(
self
) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter> where
Self: Iterator,
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::IntoIter: Clone,
<Self::Item as IntoIterator>::Item: Clone,
fn multi_cartesian_product(
self
) -> MultiProduct<<Self::Item as IntoIterator>::IntoIter> where
Self: Iterator,
Self::Item: IntoIterator,
<Self::Item as IntoIterator>::IntoIter: Clone,
<Self::Item as IntoIterator>::Item: Clone,
Return an iterator adaptor that iterates over the cartesian product of
all subiterators returned by meta-iterator self
. Read more
sourcefn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,
fn coalesce<F>(self, f: F) -> CoalesceBy<Self, F, Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Result<Self::Item, (Self::Item, Self::Item)>,
Return an iterator adaptor that uses the passed-in closure to optionally merge together consecutive elements. Read more
sourcefn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item> where
Self::Item: PartialEq<Self::Item>,
fn dedup(self) -> CoalesceBy<Self, DedupPred2CoalescePred<DedupEq>, Self::Item> where
Self::Item: PartialEq<Self::Item>,
Remove duplicates from sections of consecutive identical elements. If the iterator is sorted, all elements will be unique. Read more
sourcefn dedup_by<Cmp>(
self,
cmp: Cmp
) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item> where
Cmp: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> bool,
fn dedup_by<Cmp>(
self,
cmp: Cmp
) -> CoalesceBy<Self, DedupPred2CoalescePred<Cmp>, Self::Item> where
Cmp: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> bool,
Remove duplicates from sections of consecutive identical elements, determining equality using a comparison function. If the iterator is sorted, all elements will be unique. Read more
sourcefn dedup_with_count(
self
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>
fn dedup_with_count(
self
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<DedupEq>, (usize, Self::Item)>
Remove duplicates from sections of consecutive identical elements, while keeping a count of how many repeated elements were present. If the iterator is sorted, all elements will be unique. Read more
sourcefn dedup_by_with_count<Cmp>(
self,
cmp: Cmp
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)> where
Cmp: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> bool,
fn dedup_by_with_count<Cmp>(
self,
cmp: Cmp
) -> CoalesceBy<Self, DedupPredWithCount2CoalescePred<Cmp>, (usize, Self::Item)> where
Cmp: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> bool,
Remove duplicates from sections of consecutive identical elements, while keeping a count of how many repeated elements were present. This will determine equality using a comparison function. If the iterator is sorted, all elements will be unique. Read more
sourcefn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById> where
Self::Item: Eq,
Self::Item: Hash,
fn duplicates(self) -> DuplicatesBy<Self, Self::Item, ById> where
Self::Item: Eq,
Self::Item: Hash,
Return an iterator adaptor that produces elements that appear more than once during the iteration. Duplicates are detected using hash and equality. Read more
sourcefn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>> where
V: Eq + Hash,
F: for<'_> FnMut(&Self::Item) -> V,
fn duplicates_by<V, F>(self, f: F) -> DuplicatesBy<Self, V, ByFn<F>> where
V: Eq + Hash,
F: for<'_> FnMut(&Self::Item) -> V,
Return an iterator adaptor that produces elements that appear more than once during the iteration. Duplicates are detected using hash and equality. Read more
sourcefn unique(self) -> Unique<Self> where
Self::Item: Clone,
Self::Item: Eq,
Self::Item: Hash,
fn unique(self) -> Unique<Self> where
Self::Item: Clone,
Self::Item: Eq,
Self::Item: Hash,
Return an iterator adaptor that filters out elements that have already been produced once during the iteration. Duplicates are detected using hash and equality. Read more
sourcefn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F> where
V: Eq + Hash,
F: for<'_> FnMut(&Self::Item) -> V,
fn unique_by<V, F>(self, f: F) -> UniqueBy<Self, V, F> where
V: Eq + Hash,
F: for<'_> FnMut(&Self::Item) -> V,
Return an iterator adaptor that filters out elements that have already been produced once during the iteration. Read more
sourcefn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F> where
Self: PeekingNext,
F: for<'_> FnMut(&Self::Item) -> bool,
fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F> where
Self: PeekingNext,
F: for<'_> FnMut(&Self::Item) -> bool,
Return an iterator adaptor that borrows from this iterator and
takes items while the closure accept
returns true
. Read more
sourcefn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F> where
Self: Clone,
F: for<'_> FnMut(&Self::Item) -> bool,
fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F> where
Self: Clone,
F: for<'_> FnMut(&Self::Item) -> bool,
Return an iterator adaptor that borrows from a Clone
-able iterator
to only pick off elements while the predicate accept
returns true
. Read more
sourcefn while_some<A>(self) -> WhileSome<Self> where
Self: Iterator<Item = Option<A>>,
fn while_some<A>(self) -> WhileSome<Self> where
Self: Iterator<Item = Option<A>>,
Return an iterator adaptor that filters Option<A>
iterator elements
and produces A
. Stops on the first None
encountered. Read more
sourcefn tuple_combinations<T>(self) -> TupleCombinations<Self, T> where
Self: Clone,
T: HasCombination<Self>,
Self::Item: Clone,
fn tuple_combinations<T>(self) -> TupleCombinations<Self, T> where
Self: Clone,
T: HasCombination<Self>,
Self::Item: Clone,
Return an iterator adaptor that iterates over the combinations of the elements from an iterator. Read more
sourcefn combinations(self, k: usize) -> Combinations<Self> where
Self::Item: Clone,
fn combinations(self, k: usize) -> Combinations<Self> where
Self::Item: Clone,
Return an iterator adaptor that iterates over the k
-length combinations of
the elements from an iterator. Read more
sourcefn combinations_with_replacement(
self,
k: usize
) -> CombinationsWithReplacement<Self> where
Self::Item: Clone,
fn combinations_with_replacement(
self,
k: usize
) -> CombinationsWithReplacement<Self> where
Self::Item: Clone,
Return an iterator that iterates over the k
-length combinations of
the elements from an iterator, with replacement. Read more
sourcefn permutations(self, k: usize) -> Permutations<Self> where
Self::Item: Clone,
fn permutations(self, k: usize) -> Permutations<Self> where
Self::Item: Clone,
Return an iterator adaptor that iterates over all k-permutations of the elements from an iterator. Read more
sourcefn powerset(self) -> Powerset<Self> where
Self::Item: Clone,
fn powerset(self) -> Powerset<Self> where
Self::Item: Clone,
Return an iterator that iterates through the powerset of the elements from an iterator. Read more
sourcefn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F> where
F: FnMut(usize) -> Self::Item,
fn pad_using<F>(self, min: usize, f: F) -> PadUsing<Self, F> where
F: FnMut(usize) -> Self::Item,
Return an iterator adaptor that pads the sequence to a minimum length of
min
by filling missing elements using a closure f
. Read more
sourcefn with_position(self) -> WithPosition<Self>
fn with_position(self) -> WithPosition<Self>
Return an iterator adaptor that wraps each element in a Position
to
ease special-case handling of the first or last elements. Read more
sourcefn positions<P>(self, predicate: P) -> Positions<Self, P> where
P: FnMut(Self::Item) -> bool,
fn positions<P>(self, predicate: P) -> Positions<Self, P> where
P: FnMut(Self::Item) -> bool,
Return an iterator adaptor that yields the indices of all elements satisfying a predicate, counted from the start of the iterator. Read more
sourcefn update<F>(self, updater: F) -> Update<Self, F> where
F: for<'_> FnMut(&mut Self::Item),
fn update<F>(self, updater: F) -> Update<Self, F> where
F: for<'_> FnMut(&mut Self::Item),
Return an iterator adaptor that applies a mutating function to each element before yielding it. Read more
sourcefn next_tuple<T>(&mut self) -> Option<T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
fn next_tuple<T>(&mut self) -> Option<T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
Advances the iterator and returns the next items grouped in a tuple of a specific size (up to 12). Read more
sourcefn collect_tuple<T>(self) -> Option<T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
fn collect_tuple<T>(self) -> Option<T> where
Self: Iterator<Item = <T as TupleCollect>::Item>,
T: HomogeneousTuple,
Collects all items from the iterator into a tuple of a specific size (up to 12). Read more
sourcefn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn find_position<P>(&mut self, pred: P) -> Option<(usize, Self::Item)> where
P: for<'_> FnMut(&Self::Item) -> bool,
Find the position and value of the first element satisfying a predicate. Read more
sourcefn find_or_last<P>(self, predicate: P) -> Option<Self::Item> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn find_or_last<P>(self, predicate: P) -> Option<Self::Item> where
P: for<'_> FnMut(&Self::Item) -> bool,
Find the value of the first element satisfying a predicate or return the last element, if any. Read more
sourcefn find_or_first<P>(self, predicate: P) -> Option<Self::Item> where
P: for<'_> FnMut(&Self::Item) -> bool,
fn find_or_first<P>(self, predicate: P) -> Option<Self::Item> where
P: for<'_> FnMut(&Self::Item) -> bool,
Find the value of the first element satisfying a predicate or return the first element, if any. Read more
sourcefn contains<Q>(&mut self, query: &Q) -> bool where
Q: PartialEq<Q>,
Self::Item: Borrow<Q>,
fn contains<Q>(&mut self, query: &Q) -> bool where
Q: PartialEq<Q>,
Self::Item: Borrow<Q>,
Returns true
if the given item is present in this iterator. Read more
sourcefn all_equal(&mut self) -> bool where
Self::Item: PartialEq<Self::Item>,
fn all_equal(&mut self) -> bool where
Self::Item: PartialEq<Self::Item>,
Check whether all elements compare equal. Read more
sourcefn all_unique(&mut self) -> bool where
Self::Item: Eq,
Self::Item: Hash,
fn all_unique(&mut self) -> bool where
Self::Item: Eq,
Self::Item: Hash,
Check whether all elements are unique (non equal). Read more
sourcefn dropping(self, n: usize) -> Self
fn dropping(self, n: usize) -> Self
Consume the first n
elements from the iterator eagerly,
and return the same iterator again. Read more
sourcefn dropping_back(self, n: usize) -> Self where
Self: DoubleEndedIterator,
fn dropping_back(self, n: usize) -> Self where
Self: DoubleEndedIterator,
Consume the last n
elements from the iterator eagerly,
and return the same iterator again. Read more
sourcefn foreach<F>(self, f: F) where
F: FnMut(Self::Item),
fn foreach<F>(self, f: F) where
F: FnMut(Self::Item),
Use .for_each() instead
Run the closure f
eagerly on each element of the iterator. Read more
sourcefn concat(self) -> Self::Item where
Self::Item: Extend<<Self::Item as IntoIterator>::Item>,
Self::Item: IntoIterator,
Self::Item: Default,
fn concat(self) -> Self::Item where
Self::Item: Extend<<Self::Item as IntoIterator>::Item>,
Self::Item: IntoIterator,
Self::Item: Default,
sourcefn collect_vec(self) -> Vec<Self::Item, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn collect_vec(self) -> Vec<Self::Item, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
.collect_vec()
is simply a type specialization of Iterator::collect
,
for convenience. Read more
sourcefn try_collect<T, U, E>(self) -> Result<U, E> where
Self: Iterator<Item = Result<T, E>>,
Result<U, E>: FromIterator<Result<T, E>>,
fn try_collect<T, U, E>(self) -> Result<U, E> where
Self: Iterator<Item = Result<T, E>>,
Result<U, E>: FromIterator<Result<T, E>>,
.try_collect()
is more convenient way of writing
.collect::<Result<_, _>>()
Read more
sourcefn set_from<'a, A, J>(&mut self, from: J) -> usize where
A: 'a,
Self: Iterator<Item = &'a mut A>,
J: IntoIterator<Item = A>,
fn set_from<'a, A, J>(&mut self, from: J) -> usize where
A: 'a,
Self: Iterator<Item = &'a mut A>,
J: IntoIterator<Item = A>,
Assign to each reference in self
from the from
iterator,
stopping at the shortest of the two iterators. Read more
sourcefn join(&mut self, sep: &str) -> String where
Self::Item: Display,
fn join(&mut self, sep: &str) -> String where
Self::Item: Display,
Combine all iterator elements into one String, separated by sep
. Read more
sourcefn format(self, sep: &str) -> Format<'_, Self>
fn format(self, sep: &str) -> Format<'_, Self>
Format all iterator elements, separated by sep
. Read more
sourcefn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F> where
F: for<'_> FnMut(Self::Item, &mut dyn FnMut(&dyn Display)) -> Result<(), Error>,
fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F> where
F: for<'_> FnMut(Self::Item, &mut dyn FnMut(&dyn Display)) -> Result<(), Error>,
Format all iterator elements, separated by sep
. Read more
sourcefn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E> where
Self: Iterator<Item = Result<A, E>>,
F: FnMut(B, A) -> B,
fn fold_results<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E> where
Self: Iterator<Item = Result<A, E>>,
F: FnMut(B, A) -> B,
Use .fold_ok() instead
See .fold_ok()
.
sourcefn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E> where
Self: Iterator<Item = Result<A, E>>,
F: FnMut(B, A) -> B,
fn fold_ok<A, E, B, F>(&mut self, start: B, f: F) -> Result<B, E> where
Self: Iterator<Item = Result<A, E>>,
F: FnMut(B, A) -> B,
Fold Result
values from an iterator. Read more
sourcefn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B> where
Self: Iterator<Item = Option<A>>,
F: FnMut(B, A) -> B,
fn fold_options<A, B, F>(&mut self, start: B, f: F) -> Option<B> where
Self: Iterator<Item = Option<A>>,
F: FnMut(B, A) -> B,
Fold Option
values from an iterator. Read more
sourcefn fold1<F>(self, f: F) -> Option<Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Self::Item,
fn fold1<F>(self, f: F) -> Option<Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Self::Item,
Use Iterator::reduce
instead
Accumulator of the elements in the iterator. Read more
sourcefn tree_fold1<F>(self, f: F) -> Option<Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Self::Item,
fn tree_fold1<F>(self, f: F) -> Option<Self::Item> where
F: FnMut(Self::Item, Self::Item) -> Self::Item,
Accumulate the elements in the iterator in a tree-like manner. Read more
sourcefn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B> where
F: FnMut(B, Self::Item) -> FoldWhile<B>,
fn fold_while<B, F>(&mut self, init: B, f: F) -> FoldWhile<B> where
F: FnMut(B, Self::Item) -> FoldWhile<B>,
An iterator method that applies a function, producing a single, final value. Read more
sourcefn sum1<S>(self) -> Option<S> where
S: Sum<Self::Item>,
fn sum1<S>(self) -> Option<S> where
S: Sum<Self::Item>,
Iterate over the entire iterator and add all the elements. Read more
sourcefn product1<P>(self) -> Option<P> where
P: Product<Self::Item>,
fn product1<P>(self) -> Option<P> where
P: Product<Self::Item>,
Iterate over the entire iterator and multiply all the elements. Read more
sourcefn sorted_unstable(self) -> IntoIter<Self::Item, Global> where
Self::Item: Ord,
fn sorted_unstable(self) -> IntoIter<Self::Item, Global> where
Self::Item: Ord,
Sort all iterator elements into a new iterator in ascending order. Read more
sourcefn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn sorted_unstable_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Sort all iterator elements into a new iterator in ascending order. Read more
sourcefn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
fn sorted_unstable_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
Sort all iterator elements into a new iterator in ascending order. Read more
sourcefn sorted(self) -> IntoIter<Self::Item, Global> where
Self::Item: Ord,
fn sorted(self) -> IntoIter<Self::Item, Global> where
Self::Item: Ord,
Sort all iterator elements into a new iterator in ascending order. Read more
sourcefn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn sorted_by<F>(self, cmp: F) -> IntoIter<Self::Item, Global> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Sort all iterator elements into a new iterator in ascending order. Read more
sourcefn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
fn sorted_by_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
Sort all iterator elements into a new iterator in ascending order. Read more
sourcefn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
fn sorted_by_cached_key<K, F>(self, f: F) -> IntoIter<Self::Item, Global> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
Sort all iterator elements into a new iterator in ascending order. The key function is called exactly once per key. Read more
sourcefn k_smallest(self, k: usize) -> IntoIter<Self::Item, Global> where
Self::Item: Ord,
fn k_smallest(self, k: usize) -> IntoIter<Self::Item, Global> where
Self::Item: Ord,
Sort the k smallest elements into a new iterator, in ascending order. Read more
sourcefn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B) where
F: FnMut(Self::Item) -> Either<L, R>,
A: Default + Extend<L>,
B: Default + Extend<R>,
fn partition_map<A, B, F, L, R>(self, predicate: F) -> (A, B) where
F: FnMut(Self::Item) -> Either<L, R>,
A: Default + Extend<L>,
B: Default + Extend<R>,
Collect all iterator elements into one of two
partitions. Unlike Iterator::partition
, each partition may
have a distinct type. Read more
sourcefn partition_result<A, B, T, E>(self) -> (A, B) where
Self: Iterator<Item = Result<T, E>>,
A: Default + Extend<T>,
B: Default + Extend<E>,
fn partition_result<A, B, T, E>(self) -> (A, B) where
Self: Iterator<Item = Result<T, E>>,
A: Default + Extend<T>,
B: Default + Extend<E>,
Partition a sequence of Result
s into one list of all the Ok
elements
and another list of all the Err
elements. Read more
sourcefn into_group_map<K, V>(self) -> HashMap<K, Vec<V, Global>, RandomState> where
Self: Iterator<Item = (K, V)>,
K: Hash + Eq,
fn into_group_map<K, V>(self) -> HashMap<K, Vec<V, Global>, RandomState> where
Self: Iterator<Item = (K, V)>,
K: Hash + Eq,
Return a HashMap
of keys mapped to Vec
s of values. Keys and values
are taken from (Key, Value)
tuple pairs yielded by the input iterator. Read more
sourcefn into_group_map_by<K, V, F>(
self,
f: F
) -> HashMap<K, Vec<V, Global>, RandomState> where
Self: Iterator<Item = V>,
K: Hash + Eq,
F: for<'_> Fn(&V) -> K,
fn into_group_map_by<K, V, F>(
self,
f: F
) -> HashMap<K, Vec<V, Global>, RandomState> where
Self: Iterator<Item = V>,
K: Hash + Eq,
F: for<'_> Fn(&V) -> K,
Return an Iterator
on a HashMap
. Keys mapped to Vec
s of values. The key is specified
in the closure. Read more
sourcefn into_grouping_map<K, V>(self) -> GroupingMap<Self> where
Self: Iterator<Item = (K, V)>,
K: Hash + Eq,
fn into_grouping_map<K, V>(self) -> GroupingMap<Self> where
Self: Iterator<Item = (K, V)>,
K: Hash + Eq,
Constructs a GroupingMap
to be used later with one of the efficient
group-and-fold operations it allows to perform. Read more
sourcefn into_grouping_map_by<K, V, F>(
self,
key_mapper: F
) -> GroupingMap<MapForGrouping<Self, F>> where
Self: Iterator<Item = V>,
K: Hash + Eq,
F: for<'_> FnMut(&V) -> K,
fn into_grouping_map_by<K, V, F>(
self,
key_mapper: F
) -> GroupingMap<MapForGrouping<Self, F>> where
Self: Iterator<Item = V>,
K: Hash + Eq,
F: for<'_> FnMut(&V) -> K,
Constructs a GroupingMap
to be used later with one of the efficient
group-and-fold operations it allows to perform. Read more
sourcefn minmax(self) -> MinMaxResult<Self::Item> where
Self::Item: PartialOrd<Self::Item>,
fn minmax(self) -> MinMaxResult<Self::Item> where
Self::Item: PartialOrd<Self::Item>,
Return the minimum and maximum elements in the iterator. Read more
sourcefn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item> where
K: PartialOrd<K>,
F: for<'_> FnMut(&Self::Item) -> K,
fn minmax_by_key<K, F>(self, key: F) -> MinMaxResult<Self::Item> where
K: PartialOrd<K>,
F: for<'_> FnMut(&Self::Item) -> K,
Return the minimum and maximum element of an iterator, as determined by the specified function. Read more
sourcefn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn minmax_by<F>(self, compare: F) -> MinMaxResult<Self::Item> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Return the minimum and maximum element of an iterator, as determined by the specified comparison function. Read more
sourcefn position_max(self) -> Option<usize> where
Self::Item: Ord,
fn position_max(self) -> Option<usize> where
Self::Item: Ord,
Return the position of the maximum element in the iterator. Read more
sourcefn position_max_by_key<K, F>(self, key: F) -> Option<usize> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
fn position_max_by_key<K, F>(self, key: F) -> Option<usize> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
Return the position of the maximum element in the iterator, as determined by the specified function. Read more
sourcefn position_max_by<F>(self, compare: F) -> Option<usize> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn position_max_by<F>(self, compare: F) -> Option<usize> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Return the position of the maximum element in the iterator, as determined by the specified comparison function. Read more
sourcefn position_min(self) -> Option<usize> where
Self::Item: Ord,
fn position_min(self) -> Option<usize> where
Self::Item: Ord,
Return the position of the minimum element in the iterator. Read more
sourcefn position_min_by_key<K, F>(self, key: F) -> Option<usize> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
fn position_min_by_key<K, F>(self, key: F) -> Option<usize> where
K: Ord,
F: for<'_> FnMut(&Self::Item) -> K,
Return the position of the minimum element in the iterator, as determined by the specified function. Read more
sourcefn position_min_by<F>(self, compare: F) -> Option<usize> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn position_min_by<F>(self, compare: F) -> Option<usize> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Return the position of the minimum element in the iterator, as determined by the specified comparison function. Read more
sourcefn position_minmax(self) -> MinMaxResult<usize> where
Self::Item: PartialOrd<Self::Item>,
fn position_minmax(self) -> MinMaxResult<usize> where
Self::Item: PartialOrd<Self::Item>,
Return the positions of the minimum and maximum elements in the iterator. Read more
sourcefn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize> where
K: PartialOrd<K>,
F: for<'_> FnMut(&Self::Item) -> K,
fn position_minmax_by_key<K, F>(self, key: F) -> MinMaxResult<usize> where
K: PartialOrd<K>,
F: for<'_> FnMut(&Self::Item) -> K,
Return the postions of the minimum and maximum elements of an iterator, as determined by the specified function. Read more
sourcefn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
fn position_minmax_by<F>(self, compare: F) -> MinMaxResult<usize> where
F: for<'_, '_> FnMut(&Self::Item, &Self::Item) -> Ordering,
Return the postions of the minimum and maximum elements of an iterator, as determined by the specified comparison function. Read more
sourcefn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>
fn exactly_one(self) -> Result<Self::Item, ExactlyOneError<Self>>
If the iterator yields exactly one element, that element will be returned, otherwise an error will be returned containing an iterator that has the same output as the input iterator. Read more
sourcefn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>
fn at_most_one(self) -> Result<Option<Self::Item>, ExactlyOneError<Self>>
If the iterator yields no elements, Ok(None) will be returned. If the iterator yields exactly one element, that element will be returned, otherwise an error will be returned containing an iterator that has the same output as the input iterator. Read more
sourcefn multipeek(self) -> MultiPeek<Self>
fn multipeek(self) -> MultiPeek<Self>
An iterator adaptor that allows the user to peek at multiple .next()
values without advancing the base iterator. Read more
sourcefn counts(self) -> HashMap<Self::Item, usize, RandomState> where
Self::Item: Eq,
Self::Item: Hash,
fn counts(self) -> HashMap<Self::Item, usize, RandomState> where
Self::Item: Eq,
Self::Item: Hash,
Collect the items in this iterator and return a HashMap
which
contains each item that appears in the iterator and the number
of times it appears. Read more
sourcefn counts_by<K, F>(self, f: F) -> HashMap<K, usize, RandomState> where
K: Eq + Hash,
F: FnMut(Self::Item) -> K,
fn counts_by<K, F>(self, f: F) -> HashMap<K, usize, RandomState> where
K: Eq + Hash,
F: FnMut(Self::Item) -> K,
Collect the items in this iterator and return a HashMap
which
contains each item that appears in the iterator and the number
of times it appears,
determining identity using a keying function. Read more
sourcefn multiunzip<FromI>(self) -> FromI where
Self: MultiUnzip<FromI>,
fn multiunzip<FromI>(self) -> FromI where
Self: MultiUnzip<FromI>,
Converts an iterator of tuples into a tuple of containers. Read more
sourceimpl<IT> MultiUnzip<()> for IT where
IT: Iterator<Item = ()>,
impl<IT> MultiUnzip<()> for IT where
IT: Iterator<Item = ()>,
sourcefn multiunzip(self)
fn multiunzip(self)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI, J, FromJ, K, FromK, L, FromL> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK, FromL)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I, J, K, L)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
FromJ: Default + Extend<J>,
FromK: Default + Extend<K>,
FromL: Default + Extend<L>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI, J, FromJ, K, FromK, L, FromL> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK, FromL)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I, J, K, L)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
FromJ: Default + Extend<J>,
FromK: Default + Extend<K>,
FromL: Default + Extend<L>,
sourcefn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK, FromL)
fn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK, FromL)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI, J, FromJ, K, FromK> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I, J, K)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
FromJ: Default + Extend<J>,
FromK: Default + Extend<K>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI, J, FromJ, K, FromK> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I, J, K)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
FromJ: Default + Extend<J>,
FromK: Default + Extend<K>,
sourcefn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK)
fn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ, FromK)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI, J, FromJ> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I, J)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
FromJ: Default + Extend<J>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI, J, FromJ> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I, J)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
FromJ: Default + Extend<J>,
sourcefn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ)
fn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI, FromJ)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH, I, FromI> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H, I)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
FromI: Default + Extend<I>,
sourcefn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI)
fn multiunzip(
self
) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH, FromI)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG, H, FromH> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G, H)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
FromH: Default + Extend<H>,
sourcefn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH)
fn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG, FromH)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF, G, FromG> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF, FromG)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F, G)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
FromG: Default + Extend<G>,
sourcefn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG)
fn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE, FromF, FromG)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE, F, FromF> MultiUnzip<(FromA, FromB, FromC, FromD, FromE, FromF)> for IT where
IT: Iterator<Item = (A, B, C, D, E, F)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
FromF: Default + Extend<F>,
sourcefn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE, FromF)
fn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE, FromF)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE> MultiUnzip<(FromA, FromB, FromC, FromD, FromE)> for IT where
IT: Iterator<Item = (A, B, C, D, E)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD, E, FromE> MultiUnzip<(FromA, FromB, FromC, FromD, FromE)> for IT where
IT: Iterator<Item = (A, B, C, D, E)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
FromE: Default + Extend<E>,
sourcefn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE)
fn multiunzip(self) -> (FromA, FromB, FromC, FromD, FromE)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC, D, FromD> MultiUnzip<(FromA, FromB, FromC, FromD)> for IT where
IT: Iterator<Item = (A, B, C, D)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
impl<IT, A, FromA, B, FromB, C, FromC, D, FromD> MultiUnzip<(FromA, FromB, FromC, FromD)> for IT where
IT: Iterator<Item = (A, B, C, D)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
FromD: Default + Extend<D>,
sourcefn multiunzip(self) -> (FromA, FromB, FromC, FromD)
fn multiunzip(self) -> (FromA, FromB, FromC, FromD)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB, C, FromC> MultiUnzip<(FromA, FromB, FromC)> for IT where
IT: Iterator<Item = (A, B, C)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
impl<IT, A, FromA, B, FromB, C, FromC> MultiUnzip<(FromA, FromB, FromC)> for IT where
IT: Iterator<Item = (A, B, C)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
FromC: Default + Extend<C>,
sourcefn multiunzip(self) -> (FromA, FromB, FromC)
fn multiunzip(self) -> (FromA, FromB, FromC)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA, B, FromB> MultiUnzip<(FromA, FromB)> for IT where
IT: Iterator<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
impl<IT, A, FromA, B, FromB> MultiUnzip<(FromA, FromB)> for IT where
IT: Iterator<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
sourcefn multiunzip(self) -> (FromA, FromB)
fn multiunzip(self) -> (FromA, FromB)
Unzip this iterator into multiple collections.
sourceimpl<IT, A, FromA> MultiUnzip<(FromA,)> for IT where
IT: Iterator<Item = (A,)>,
FromA: Default + Extend<A>,
impl<IT, A, FromA> MultiUnzip<(FromA,)> for IT where
IT: Iterator<Item = (A,)>,
FromA: Default + Extend<A>,
sourcefn multiunzip(self) -> (FromA,)
fn multiunzip(self) -> (FromA,)
Unzip this iterator into multiple collections.
sourceimpl<R> ReadBytesExt for R where
R: Read + ?Sized,
impl<R> ReadBytesExt for R where
R: Read + ?Sized,
sourcefn read_u8(&mut self) -> Result<u8, Error>
fn read_u8(&mut self) -> Result<u8, Error>
Reads an unsigned 8 bit integer from the underlying reader. Read more
sourcefn read_i8(&mut self) -> Result<i8, Error>
fn read_i8(&mut self) -> Result<i8, Error>
Reads a signed 8 bit integer from the underlying reader. Read more
sourcefn read_u16<T>(&mut self) -> Result<u16, Error> where
T: ByteOrder,
fn read_u16<T>(&mut self) -> Result<u16, Error> where
T: ByteOrder,
Reads an unsigned 16 bit integer from the underlying reader. Read more
sourcefn read_i16<T>(&mut self) -> Result<i16, Error> where
T: ByteOrder,
fn read_i16<T>(&mut self) -> Result<i16, Error> where
T: ByteOrder,
Reads a signed 16 bit integer from the underlying reader. Read more
sourcefn read_u24<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
fn read_u24<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
Reads an unsigned 24 bit integer from the underlying reader. Read more
sourcefn read_i24<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
fn read_i24<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
Reads a signed 24 bit integer from the underlying reader. Read more
sourcefn read_u32<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
fn read_u32<T>(&mut self) -> Result<u32, Error> where
T: ByteOrder,
Reads an unsigned 32 bit integer from the underlying reader. Read more
sourcefn read_i32<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
fn read_i32<T>(&mut self) -> Result<i32, Error> where
T: ByteOrder,
Reads a signed 32 bit integer from the underlying reader. Read more
sourcefn read_u48<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
fn read_u48<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
Reads an unsigned 48 bit integer from the underlying reader. Read more
sourcefn read_i48<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
fn read_i48<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
Reads a signed 48 bit integer from the underlying reader. Read more
sourcefn read_u64<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
fn read_u64<T>(&mut self) -> Result<u64, Error> where
T: ByteOrder,
Reads an unsigned 64 bit integer from the underlying reader. Read more
sourcefn read_i64<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
fn read_i64<T>(&mut self) -> Result<i64, Error> where
T: ByteOrder,
Reads a signed 64 bit integer from the underlying reader. Read more
sourcefn read_u128<T>(&mut self) -> Result<u128, Error> where
T: ByteOrder,
fn read_u128<T>(&mut self) -> Result<u128, Error> where
T: ByteOrder,
Reads an unsigned 128 bit integer from the underlying reader. Read more
sourcefn read_i128<T>(&mut self) -> Result<i128, Error> where
T: ByteOrder,
fn read_i128<T>(&mut self) -> Result<i128, Error> where
T: ByteOrder,
Reads a signed 128 bit integer from the underlying reader. Read more
sourcefn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error> where
T: ByteOrder,
fn read_uint<T>(&mut self, nbytes: usize) -> Result<u64, Error> where
T: ByteOrder,
Reads an unsigned n-bytes integer from the underlying reader. Read more
sourcefn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error> where
T: ByteOrder,
fn read_int<T>(&mut self, nbytes: usize) -> Result<i64, Error> where
T: ByteOrder,
Reads a signed n-bytes integer from the underlying reader. Read more
sourcefn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error> where
T: ByteOrder,
fn read_uint128<T>(&mut self, nbytes: usize) -> Result<u128, Error> where
T: ByteOrder,
Reads an unsigned n-bytes integer from the underlying reader.
sourcefn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error> where
T: ByteOrder,
fn read_int128<T>(&mut self, nbytes: usize) -> Result<i128, Error> where
T: ByteOrder,
Reads a signed n-bytes integer from the underlying reader.
sourcefn read_f32<T>(&mut self) -> Result<f32, Error> where
T: ByteOrder,
fn read_f32<T>(&mut self) -> Result<f32, Error> where
T: ByteOrder,
Reads a IEEE754 single-precision (4 bytes) floating point number from the underlying reader. Read more
sourcefn read_f64<T>(&mut self) -> Result<f64, Error> where
T: ByteOrder,
fn read_f64<T>(&mut self) -> Result<f64, Error> where
T: ByteOrder,
Reads a IEEE754 double-precision (8 bytes) floating point number from the underlying reader. Read more
sourcefn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error> where
T: ByteOrder,
fn read_u16_into<T>(&mut self, dst: &mut [u16]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 16 bit integers from the underlying reader. Read more
sourcefn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error> where
T: ByteOrder,
fn read_u32_into<T>(&mut self, dst: &mut [u32]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 32 bit integers from the underlying reader. Read more
sourcefn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error> where
T: ByteOrder,
fn read_u64_into<T>(&mut self, dst: &mut [u64]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 64 bit integers from the underlying reader. Read more
sourcefn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error> where
T: ByteOrder,
fn read_u128_into<T>(&mut self, dst: &mut [u128]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of unsigned 128 bit integers from the underlying reader. Read more
sourcefn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>
fn read_i8_into(&mut self, dst: &mut [i8]) -> Result<(), Error>
Reads a sequence of signed 8 bit integers from the underlying reader. Read more
sourcefn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error> where
T: ByteOrder,
fn read_i16_into<T>(&mut self, dst: &mut [i16]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 16 bit integers from the underlying reader. Read more
sourcefn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error> where
T: ByteOrder,
fn read_i32_into<T>(&mut self, dst: &mut [i32]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 32 bit integers from the underlying reader. Read more
sourcefn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error> where
T: ByteOrder,
fn read_i64_into<T>(&mut self, dst: &mut [i64]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 64 bit integers from the underlying reader. Read more
sourcefn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error> where
T: ByteOrder,
fn read_i128_into<T>(&mut self, dst: &mut [i128]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of signed 128 bit integers from the underlying reader. Read more
sourcefn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
fn read_f32_into<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
Reads a sequence of IEEE754 single-precision (4 bytes) floating point numbers from the underlying reader. Read more
sourcefn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
fn read_f32_into_unchecked<T>(&mut self, dst: &mut [f32]) -> Result<(), Error> where
T: ByteOrder,
please use read_f32_into
instead
DEPRECATED. Read more
sourceimpl<T> ToHex for T where
T: AsRef<[u8]>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
sourcefn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read more
sourcefn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more
sourceimpl<I> UnicodeNormalization<I> for I where
I: Iterator<Item = char>,
impl<I> UnicodeNormalization<I> for I where
I: Iterator<Item = char>,
sourcefn nfd(self) -> Decompositions<I>
fn nfd(self) -> Decompositions<I>
Returns an iterator over the string in Unicode Normalization Form D (canonical decomposition). Read more
sourcefn nfkd(self) -> Decompositions<I>
fn nfkd(self) -> Decompositions<I>
Returns an iterator over the string in Unicode Normalization Form KD (compatibility decomposition). Read more
sourcefn nfc(self) -> Recompositions<I>
fn nfc(self) -> Recompositions<I>
An Iterator over the string in Unicode Normalization Form C (canonical decomposition followed by canonical composition). Read more
sourcefn nfkc(self) -> Recompositions<I>
fn nfkc(self) -> Recompositions<I>
An Iterator over the string in Unicode Normalization Form KC (compatibility decomposition followed by canonical composition). Read more
sourcefn cjk_compat_variants(self) -> Replacements<I>
fn cjk_compat_variants(self) -> Replacements<I>
A transformation which replaces CJK Compatibility Ideograph codepoints with normal forms using Standardized Variation Sequences. This is not part of the canonical or compatibility decomposition algorithms, but performing it before those algorithms produces normalized output which better preserves the intent of the original text. Read more
sourcefn stream_safe(self) -> StreamSafe<I>
fn stream_safe(self) -> StreamSafe<I>
An Iterator over the string with Conjoining Grapheme Joiner characters inserted according to the Stream-Safe Text Process (UAX15-D4) Read more
sourceimpl<W> WriteBytesExt for W where
W: Write + ?Sized,
impl<W> WriteBytesExt for W where
W: Write + ?Sized,
sourcefn write_u8(&mut self, n: u8) -> Result<(), Error>
fn write_u8(&mut self, n: u8) -> Result<(), Error>
Writes an unsigned 8 bit integer to the underlying writer. Read more
sourcefn write_i8(&mut self, n: i8) -> Result<(), Error>
fn write_i8(&mut self, n: i8) -> Result<(), Error>
Writes a signed 8 bit integer to the underlying writer. Read more
sourcefn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
T: ByteOrder,
fn write_u16<T>(&mut self, n: u16) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 16 bit integer to the underlying writer. Read more
sourcefn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
T: ByteOrder,
fn write_i16<T>(&mut self, n: i16) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 16 bit integer to the underlying writer. Read more
sourcefn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
fn write_u24<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 24 bit integer to the underlying writer. Read more
sourcefn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
fn write_i24<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 24 bit integer to the underlying writer. Read more
sourcefn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
fn write_u32<T>(&mut self, n: u32) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 32 bit integer to the underlying writer. Read more
sourcefn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
fn write_i32<T>(&mut self, n: i32) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 32 bit integer to the underlying writer. Read more
sourcefn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
fn write_u48<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 48 bit integer to the underlying writer. Read more
sourcefn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
fn write_i48<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 48 bit integer to the underlying writer. Read more
sourcefn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
fn write_u64<T>(&mut self, n: u64) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 64 bit integer to the underlying writer. Read more
sourcefn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
fn write_i64<T>(&mut self, n: i64) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 64 bit integer to the underlying writer. Read more
sourcefn write_u128<T>(&mut self, n: u128) -> Result<(), Error> where
T: ByteOrder,
fn write_u128<T>(&mut self, n: u128) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned 128 bit integer to the underlying writer.
sourcefn write_i128<T>(&mut self, n: i128) -> Result<(), Error> where
T: ByteOrder,
fn write_i128<T>(&mut self, n: i128) -> Result<(), Error> where
T: ByteOrder,
Writes a signed 128 bit integer to the underlying writer.
sourcefn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_uint<T>(&mut self, n: u64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned n-bytes integer to the underlying writer. Read more
sourcefn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_int<T>(&mut self, n: i64, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes a signed n-bytes integer to the underlying writer. Read more
sourcefn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_uint128<T>(&mut self, n: u128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes an unsigned n-bytes integer to the underlying writer. Read more
sourcefn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
fn write_int128<T>(&mut self, n: i128, nbytes: usize) -> Result<(), Error> where
T: ByteOrder,
Writes a signed n-bytes integer to the underlying writer. Read more