pub enum Among<L, M, R> {
Left(L),
Middle(M),
Right(R),
}Expand description
The enum Among with variants Left, Middle and Right is a general purpose
sum type with three cases.
The Among type is symmetric and treats its variants the same way, without
preference.
(For representing success or error, use the regular Result enum instead.)
Variants§
Implementations§
Source§impl<L, M, R> Among<L, M, R>
impl<L, M, R> Among<L, M, R>
Sourcepub fn try_into_left_middle(self) -> Result<Either<L, M>, R>
Available on crate feature either only.
pub fn try_into_left_middle(self) -> Result<Either<L, M>, R>
either only.Try to convert the Among to Either<L, M>. If the Among is Right, it will return an error.
See also into_left_middle.
§Examples
use either::Either;
use among::Among;
let among: Among<i32, (), ()> = Among::Left(1);
let either = among.try_into_left_middle().unwrap();
assert_eq!(either, Either::Left(1));
let among: Among<(), i32, ()> = Among::Middle(2);
let either = among.try_into_left_middle().unwrap();
assert_eq!(either, Either::Right(2));Sourcepub fn into_left_middle(self) -> Either<L, M>
Available on crate feature either only.
pub fn into_left_middle(self) -> Either<L, M>
either only.Attempts to convert the Among to Either<L, M>. If the Among is Right, it will panic.
See also try_into_left_middle.
§Examples
use either::Either;
use among::Among;
let among: Among<i32, (), ()> = Among::Left(1);
let either = among.into_left_middle();
assert_eq!(either, Either::Left(1));
let among: Among<(), i32, ()> = Among::Middle(2);
let either = among.into_left_middle();
assert_eq!(either, Either::Right(2));Sourcepub fn try_into_middle_right(self) -> Result<Either<M, R>, L>
Available on crate feature either only.
pub fn try_into_middle_right(self) -> Result<Either<M, R>, L>
either only.Try to convert the Among to Either<M, R>. If the Among is Left, it will return an error.
See also into_middle_right.
§Examples
use either::Either;
use among::Among;
let among: Among<(), i32, ()> = Among::Middle(2);
let either = among.try_into_middle_right().unwrap();
assert_eq!(either, Either::Left(2));
let among: Among<(), (), i32> = Among::Right(3);
let either = among.try_into_middle_right().unwrap();
assert_eq!(either, Either::Right(3));Sourcepub fn into_middle_right(self) -> Either<M, R>
Available on crate feature either only.
pub fn into_middle_right(self) -> Either<M, R>
either only.Attempts to convert the Among to Either<M, R>. If the Among is Left, it will panic.
See also try_into_middle_right.
§Examples
use either::Either;
use among::Among;
let among: Among<(), i32, ()> = Among::Middle(2);
let either = among.into_middle_right();
assert_eq!(either, Either::Left(2));
let among: Among<(), (), i32> = Among::Right(3);
let either = among.into_middle_right();
assert_eq!(either, Either::Right(3));Sourcepub fn try_into_left_right(self) -> Result<Either<L, R>, M>
Available on crate feature either only.
pub fn try_into_left_right(self) -> Result<Either<L, R>, M>
either only.Try to convert the Among to Either<L, R>. If the Among is Middle, it will return an error.
See also into_left_right.
§Examples
use either::Either;
use among::Among;
let among: Among<i32, (), i32> = Among::Left(1);
let either = among.try_into_left_right().unwrap();
assert_eq!(either, Either::Left(1));
let among: Among<(), i32, i32> = Among::Right(3);
let either = among.try_into_left_right().unwrap();
assert_eq!(either, Either::Right(3));Sourcepub fn into_left_right(self) -> Either<L, R>
Available on crate feature either only.
pub fn into_left_right(self) -> Either<L, R>
either only.Attempts to convert the Among to Either<L, R>. If the Among is Middle, it will panic.
See also try_into_left_right.
§Examples
use either::Either;
use among::Among;
let among: Among<i32, (), i32> = Among::Left(1);
let either = among.into_left_right();
assert_eq!(either, Either::Left(1));
let among: Among<(), i32, i32> = Among::Right(3);
let either = among.into_left_right();
assert_eq!(either, Either::Right(3));
Sourcepub fn from_either_to_left_right(either: Either<L, R>) -> Among<L, M, R> ⓘ
Available on crate feature either only.
pub fn from_either_to_left_right(either: Either<L, R>) -> Among<L, M, R> ⓘ
either only.Converts the Either<L, R> to Among<L, M, R>.
§Examples
use either::Either;
use among::Among;
let either1: Either<i32, u32> = Either::Left(1);
let either2: Either<i32, u32> = Either::Right(2);
let among = Among::<i32, (), u32>::from_either_to_left_right(either1);
assert_eq!(among, Among::Left(1));
let among = Among::<i32, (), u32>::from_either_to_left_right(either2);
assert_eq!(among, Among::Right(2));Sourcepub fn from_either_to_left_middle(either: Either<L, M>) -> Among<L, M, R> ⓘ
Available on crate feature either only.
pub fn from_either_to_left_middle(either: Either<L, M>) -> Among<L, M, R> ⓘ
either only.Converts the Either<L, M> to Among<L, M, R>.
§Examples
use either::Either;
use among::Among;
let either1: Either<i32, u32> = Either::Left(1);
let either2: Either<i32, u32> = Either::Right(2);
let among = Among::<i32, u32, ()>::from_either_to_left_middle(either1);
assert_eq!(among, Among::Left(1));
let among = Among::<i32, u32, ()>::from_either_to_left_middle(either2);
assert_eq!(among, Among::Middle(2));Sourcepub fn from_either_to_middle_right(either: Either<M, R>) -> Among<L, M, R> ⓘ
Available on crate feature either only.
pub fn from_either_to_middle_right(either: Either<M, R>) -> Among<L, M, R> ⓘ
either only.Converts the Either<M, R> to Among<L, M, R>.
§Examples
use either::Either;
use among::Among;
let either1: Either<u32, i32> = Either::Left(1);
let either2: Either<u32, i32> = Either::Right(2);
let among = Among::<(), u32, i32>::from_either_to_middle_right(either1);
assert_eq!(among, Among::Middle(1));
let among = Among::<(), u32, i32>::from_either_to_middle_right(either2);
assert_eq!(among, Among::Right(2));Source§impl<L, M, R> Among<L, M, R>
impl<L, M, R> Among<L, M, R>
Sourcepub fn is_left(&self) -> bool
pub fn is_left(&self) -> bool
Return true if the value is the Left variant.
use among::*;
let values = [Left(1), Middle(b"the middle value"), Right("the right value")];
assert_eq!(values[0].is_left(), true);
assert_eq!(values[1].is_left(), false);
assert_eq!(values[2].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 among::*;
let values = [Left(1), Middle(b"the middle value"), Right("the right value")];
assert_eq!(values[0].is_right(), false);
assert_eq!(values[1].is_right(), false);
assert_eq!(values[2].is_right(), true);Sourcepub fn is_middle(&self) -> bool
pub fn is_middle(&self) -> bool
Return true if the value is the Right variant.
use among::*;
let values = [Left(1), Middle(b"the middle value"), Right("the right value")];
assert_eq!(values[0].is_middle(), false);
assert_eq!(values[1].is_middle(), true);
assert_eq!(values[2].is_middle(), false);Sourcepub fn left(self) -> Option<L>
pub fn left(self) -> Option<L>
Convert the left side of Among<L, M, R> to an Option<L>.
use among::*;
let left: Among<_, i64, ()> = Left("some value");
assert_eq!(left.left(), Some("some value"));
let right: Among<(), i64, _> = Right(321);
assert_eq!(right.left(), None);
let middle: Among<(), i64, ()> = Middle(-321);
assert_eq!(middle.left(), None);Sourcepub fn middle(self) -> Option<M>
pub fn middle(self) -> Option<M>
Convert the middle of Among<L, M, R> to an Option<M>.
use among::*;
let left: Among<_, i64, ()> = Left("some value");
assert_eq!(left.middle(), None);
let right: Among<(), i64, _> = Right(321);
assert_eq!(right.middle(), None);
let middle: Among<(), i64, ()> = Middle(-321);
assert_eq!(middle.middle(), Some(-321));Sourcepub fn right(self) -> Option<R>
pub fn right(self) -> Option<R>
Convert the right side of Among<L, M, R> to an Option<R>.
use among::*;
let left: Among<_, i64, ()> = Left("some value");
assert_eq!(left.right(), None);
let middle: Among<(), i64, ()> = Middle(-321);
assert_eq!(middle.right(), None);
let right: Among<(), i64, _> = Right(321);
assert_eq!(right.right(), Some(321));Sourcepub fn as_ref(&self) -> Among<&L, &M, &R> ⓘ
pub fn as_ref(&self) -> Among<&L, &M, &R> ⓘ
Convert &Among<L, M, R> to Among<&L, &M, &R>.
use among::*;
let left: Among<_, i64, ()> = Left("some value");
assert_eq!(left.as_ref(), Left(&"some value"));
let right: Among<(), i64, _> = Right("some value");
assert_eq!(right.as_ref(), Right(&"some value"));
let middle: Among<(), _, ()> = Middle(-321);
assert_eq!(middle.as_ref(), Middle(&-321));Sourcepub fn as_mut(&mut self) -> Among<&mut L, &mut M, &mut R> ⓘ
pub fn as_mut(&mut self) -> Among<&mut L, &mut M, &mut R> ⓘ
Convert &mut Among<L, M, R> to Among<&mut L, &mut M, &mut R>.
use among::*;
fn mutate_left(value: &mut Among<u32, u32, u32>) {
if let Some(l) = value.as_mut().left() {
*l = 999;
}
}
let mut left = Left(123);
let mut middle = Middle(123);
let mut right = Right(123);
mutate_left(&mut left);
mutate_left(&mut right);
mutate_left(&mut middle);
assert_eq!(left, Left(999));
assert_eq!(right, Right(123));
assert_eq!(middle, Middle(123));Sourcepub fn as_pin_ref(self: Pin<&Self>) -> Among<Pin<&L>, Pin<&M>, Pin<&R>> ⓘ
pub fn as_pin_ref(self: Pin<&Self>) -> Among<Pin<&L>, Pin<&M>, Pin<&R>> ⓘ
Convert Pin<&Among<L, M, R>> to Among<Pin<&L>, Pin<&M>, Pin<&R>>,
pinned projections of the inner variants.
Sourcepub fn as_pin_mut(
self: Pin<&mut Self>,
) -> Among<Pin<&mut L>, Pin<&mut M>, Pin<&mut R>> ⓘ
pub fn as_pin_mut( self: Pin<&mut Self>, ) -> Among<Pin<&mut L>, Pin<&mut M>, Pin<&mut R>> ⓘ
Convert Pin<&mut Among<L, M, R>> to Among<Pin<&mut L>, Pin<&mut M>, Pin<&mut R>>,
pinned projections of the inner variants.
Sourcepub fn flip(self) -> Among<R, M, L> ⓘ
pub fn flip(self) -> Among<R, M, L> ⓘ
Convert Among<L, M, R> to Among<R, M, L>.
use among::*;
let left: Among<_, i64, ()> = Left(123);
assert_eq!(left.flip(), Right(123));
let right: Among<(), i64, _> = Right("some value");
assert_eq!(right.flip(), Left("some value"));Sourcepub fn map_left<F, N>(self, f: F) -> Among<N, M, R> ⓘwhere
F: FnOnce(L) -> N,
pub fn map_left<F, N>(self, f: F) -> Among<N, M, R> ⓘwhere
F: FnOnce(L) -> N,
Apply the function f on the value in the Left variant if it is present rewrapping the
result in Left.
use among::*;
let left: Among<_, u32, u32> = Left(123);
assert_eq!(left.map_left(|x| x * 2), Left(246));
let right: Among<u32, u32, _> = Right(123);
assert_eq!(right.map_left(|x| x * 2), Right(123));
let middle: Among<u32, _, u32> = Middle(123);
assert_eq!(middle.map_left(|x| x * 3), Middle(123));Sourcepub fn map_middle<F, N>(self, f: F) -> Among<L, N, R> ⓘwhere
F: FnOnce(M) -> N,
pub fn map_middle<F, N>(self, f: F) -> Among<L, N, R> ⓘwhere
F: FnOnce(M) -> N,
Apply the function f on the value in the Middle variant if it is present rewrapping the
result in Middle.
use among::*;
let left: Among<_, u32, u32> = Left(123);
assert_eq!(left.map_middle(|x| x * 2), Left(123));
let right: Among<u32, u32, _> = Right(123);
assert_eq!(right.map_middle(|x| x * 2), Right(123));
let middle: Among<u32, _, u32> = Middle(123);
assert_eq!(middle.map_middle(|x| x * 3), Middle(369));Sourcepub fn map_right<F, S>(self, f: F) -> Among<L, M, S> ⓘwhere
F: FnOnce(R) -> S,
pub fn map_right<F, S>(self, f: F) -> Among<L, M, S> ⓘwhere
F: FnOnce(R) -> S,
Apply the function f on the value in the Right variant if it is present rewrapping the
result in Right.
use among::*;
let left: Among<_, u32, u32> = Left(123);
assert_eq!(left.map_right(|x| x * 2), Left(123));
let right: Among<u32, u32, _> = Right(123);
assert_eq!(right.map_right(|x| x * 2), Right(246));
let middle: Among<u32, _, u32> = Middle(123);
assert_eq!(middle.map_right(|x| x * 3), Middle(123));Sourcepub fn map_among<F, G, H, S, T, U>(self, f: F, g: G, h: H) -> Among<S, T, U> ⓘ
pub fn map_among<F, G, H, S, T, U>(self, f: F, g: G, h: H) -> Among<S, T, U> ⓘ
Apply the functions f and g to the Left and Right variants
respectively. This is equivalent to
bimap
in functional programming.
use among::*;
let f = |s: String| s.len();
let h = |t: u8| t.to_string();
let g = |u: usize| u * 2;
let left: Among<String, usize, u8> = Left("loopy".into());
assert_eq!(left.map_among(f, g, h), Left(5));
let right: Among<String, usize, u8> = Right(42);
assert_eq!(right.map_among(f, g, h), Right("42".into()));Sourcepub fn map_among_with<Ctx, F, G, H, S, T, U>(
self,
ctx: Ctx,
f: F,
g: G,
h: H,
) -> Among<S, T, U> ⓘ
pub fn map_among_with<Ctx, F, G, H, S, T, U>( self, ctx: Ctx, f: F, g: G, h: H, ) -> Among<S, T, U> ⓘ
Similar to map_among, with an added context ctx accessible to
both functions.
use among::*;
let mut sum = 0;
// Both closures want to update the same value, so pass it as context.
let mut f = |sum: &mut usize, s: String| { *sum += s.len(); s.to_uppercase() };
let mut g = |sum: &mut usize, i: i32| { *sum += i as usize; i.to_string() };
let mut h = |sum: &mut usize, u: usize| { *sum += u; u.to_string() };
let left: Among<String, i32, usize> = Left("loopy".into());
assert_eq!(left.map_among_with(&mut sum, &mut f, &mut g, &mut h), Left("LOOPY".into()));
let right: Among<String, i32, usize> = Right(42);
assert_eq!(right.map_among_with(&mut sum, &mut f, &mut g, &mut h), Right("42".into()));
let middle: Among<String, i32, usize> = Middle(3);
assert_eq!(middle.map_among_with(&mut sum, &mut f, &mut g, &mut h), Middle("3".into()));
assert_eq!(sum, 50);Sourcepub fn among<F, G, H, T>(self, f: F, g: G, h: H) -> T
pub fn among<F, G, H, T>(self, f: F, g: G, h: H) -> T
Apply one of three functions depending on contents, unifying their result. If the value is
Left(L) then the first function f is applied; if it is Middle(M) then the second function g is applied;
if it is Right(R) then the third function h is applied.
use among::*;
fn square(n: u32) -> i32 { (n * n) as i32 }
fn negate(n: i32) -> i32 { -n }
fn cube(n: u64) -> i32 { (n * n * n) as i32 }
let left: Among<u32, u64, i32> = Left(4);
assert_eq!(left.among(square, cube, negate), 16);
let right: Among<u32, u64, i32> = Right(-4);
assert_eq!(right.among(square, cube, negate), 4);
let middle: Among<u32, u64, i32> = Middle(3);
assert_eq!(middle.among(square, cube, negate), 27);Sourcepub fn among_with<Ctx, F, G, H, T>(self, ctx: Ctx, f: F, g: G, h: H) -> T
pub fn among_with<Ctx, F, G, H, T>(self, ctx: Ctx, f: F, g: G, h: H) -> T
Like among, but provide some context to whichever of the
functions ends up being called.
// In this example, the context is a mutable reference
use among::*;
let mut result = Vec::new();
let values = vec![Left(2), Middle(-3), Right(2.7)];
for value in values {
value.among_with(&mut result,
|ctx, integer| ctx.push(integer),
|ctx, neg| ctx.push(neg),
|ctx, real| ctx.push(f64::round(real) as i32));
}
assert_eq!(result, vec![2, -3, 3]);Sourcepub fn left_and_then<F, S>(self, f: F) -> Among<S, M, R> ⓘ
pub fn left_and_then<F, S>(self, f: F) -> Among<S, M, R> ⓘ
Apply the function f on the value in the Left variant if it is present.
use among::*;
let left: Among<_, u32, u32> = Left(123);
assert_eq!(left.left_and_then::<_, ()>(|x| Right(x * 2)), Right(246));
let right: Among<u32, u32, _> = Right(123);
assert_eq!(right.left_and_then(|x| Right::<(), _, _>(x * 2)), Right(123));Sourcepub fn middle_and_then<F, S>(self, f: F) -> Among<L, S, R> ⓘ
pub fn middle_and_then<F, S>(self, f: F) -> Among<L, S, R> ⓘ
Apply the function f on the value in the Middle variant if it is present.
use among::*;
let middle: Among<u32, _, u32> = Middle(123);
assert_eq!(middle.middle_and_then::<_, ()>(|x| Right(x * 2)), Right(246));
let right: Among<u32, u32, _> = Right(123);
assert_eq!(right.middle_and_then(|x| Right::<_, (), _>(x * 2)), Right(123));Sourcepub fn right_and_then<F, S>(self, f: F) -> Among<L, M, S> ⓘ
pub fn right_and_then<F, S>(self, f: F) -> Among<L, M, S> ⓘ
Apply the function f on the value in the Right variant if it is present.
use among::*;
let left: Among<_, u32, u32> = Left(123);
assert_eq!(left.right_and_then(|x| Right(x * 2)), Left(123));
let right: Among<u32, u32, _> = Right(123);
assert_eq!(right.right_and_then(|x| Right(x * 2)), Right(246));Sourcepub fn into_iter(self) -> Among<L::IntoIter, M::IntoIter, R::IntoIter> ⓘ
pub fn into_iter(self) -> Among<L::IntoIter, M::IntoIter, R::IntoIter> ⓘ
Convert the inner value to an iterator.
This requires the Left, Middle and Right iterators to have the same item type.
See factor_into_iter to iterate different types.
use among::*;
let left: Among<Vec<u32>, Vec<u32>, Vec<u32>> = Left(vec![1, 2, 3, 4, 5]);
let mut right: Among<Vec<u32>, Vec<u32>, Vec<u32>> = Right(vec![]);
right.extend(left.into_iter());
assert_eq!(right, Right(vec![1, 2, 3, 4, 5]));Sourcepub fn iter(
&self,
) -> Among<<&L as IntoIterator>::IntoIter, <&M as IntoIterator>::IntoIter, <&R as IntoIterator>::IntoIter> ⓘwhere
for<'a> &'a L: IntoIterator,
for<'a> &'a M: IntoIterator<Item = <&'a L as IntoIterator>::Item>,
for<'a> &'a R: IntoIterator<Item = <&'a L as IntoIterator>::Item>,
pub fn iter(
&self,
) -> Among<<&L as IntoIterator>::IntoIter, <&M as IntoIterator>::IntoIter, <&R as IntoIterator>::IntoIter> ⓘwhere
for<'a> &'a L: IntoIterator,
for<'a> &'a M: IntoIterator<Item = <&'a L as IntoIterator>::Item>,
for<'a> &'a R: IntoIterator<Item = <&'a L as IntoIterator>::Item>,
Borrow the inner value as an iterator.
This requires the Left, Middle and Right iterators to have the same item type.
See factor_iter to iterate different types.
use among::*;
let left: Among<_, &[u32], &[u32]> = Left(vec![2, 3]);
let mut right: Among<Vec<u32>, &[u32], _> = Right(&[4, 5][..]);
let mut all = vec![1];
all.extend(left.iter());
all.extend(right.iter());
assert_eq!(all, vec![1, 2, 3, 4, 5]);Sourcepub fn iter_mut(
&mut self,
) -> Among<<&mut L as IntoIterator>::IntoIter, <&mut M as IntoIterator>::IntoIter, <&mut R as IntoIterator>::IntoIter> ⓘwhere
for<'a> &'a mut L: IntoIterator,
for<'a> &'a mut M: IntoIterator<Item = <&'a mut L as IntoIterator>::Item>,
for<'a> &'a mut R: IntoIterator<Item = <&'a mut L as IntoIterator>::Item>,
pub fn iter_mut(
&mut self,
) -> Among<<&mut L as IntoIterator>::IntoIter, <&mut M as IntoIterator>::IntoIter, <&mut R as IntoIterator>::IntoIter> ⓘwhere
for<'a> &'a mut L: IntoIterator,
for<'a> &'a mut M: IntoIterator<Item = <&'a mut L as IntoIterator>::Item>,
for<'a> &'a mut R: IntoIterator<Item = <&'a mut L as IntoIterator>::Item>,
Mutably borrow the inner value as an iterator.
This requires the Left, Middle and Right iterators to have the same item type.
See factor_iter_mut to iterate different types.
use among::*;
let mut left: Among<_, Vec<u32>, &mut [u32]> = Left(vec![2, 3]);
for l in left.iter_mut() {
*l *= *l
}
assert_eq!(left, Left(vec![4, 9]));
let mut inner = [4, 5];
let mut right: Among<Vec<u32>, Vec<u32>, _> = Right(&mut inner[..]);
for r in right.iter_mut() {
*r *= *r
}
assert_eq!(inner, [16, 25]);
let mut inner = [6, 7];
let mut middle: Among<Vec<u32>, _, Vec<u32>> = Middle(&mut inner[..]);
for r in middle.iter_mut() {
*r *= *r
}
assert_eq!(inner, [36, 49]);Sourcepub fn factor_into_iter(
self,
) -> IterAmong<L::IntoIter, M::IntoIter, R::IntoIter> ⓘ
pub fn factor_into_iter( self, ) -> IterAmong<L::IntoIter, M::IntoIter, R::IntoIter> ⓘ
Converts an Among of Iterators to be an Iterator of Amongs
Unlike into_iter, this does not require the
Left and Right iterators to have the same item type.
use among::*;
let left: Among<_, Box<[u8]>, Vec<u8>> = Left(&["hello"]);
assert_eq!(left.factor_into_iter().next(), Some(Left(&"hello")));
let right: Among<&[&str], Box<[u8]>, _> = Right(vec![0, 1]);
assert_eq!(right.factor_into_iter().collect::<Vec<_>>(), vec![Right(0), Right(1)]);
Sourcepub fn factor_iter(
&self,
) -> IterAmong<<&L as IntoIterator>::IntoIter, <&M as IntoIterator>::IntoIter, <&R as IntoIterator>::IntoIter> ⓘ
pub fn factor_iter( &self, ) -> IterAmong<<&L as IntoIterator>::IntoIter, <&M as IntoIterator>::IntoIter, <&R as IntoIterator>::IntoIter> ⓘ
Borrows an Among of Iterators to be an Iterator of Amongs
Unlike iter, this does not require the
Left, Middle and Right iterators to have the same item type.
use among::*;
let left: Among<_, Box<[u8]>, Vec<u8>> = Left(["hello"]);
assert_eq!(left.factor_iter().next(), Some(Left(&"hello")));
let right: Among<[&str; 2], Box<[u8]>, _> = Right(vec![0, 1]);
assert_eq!(right.factor_iter().collect::<Vec<_>>(), vec![Right(&0), Right(&1)]);
Sourcepub fn factor_iter_mut(
&mut self,
) -> IterAmong<<&mut L as IntoIterator>::IntoIter, <&mut M as IntoIterator>::IntoIter, <&mut R as IntoIterator>::IntoIter> ⓘwhere
for<'a> &'a mut L: IntoIterator,
for<'a> &'a mut M: IntoIterator,
for<'a> &'a mut R: IntoIterator,
pub fn factor_iter_mut(
&mut self,
) -> IterAmong<<&mut L as IntoIterator>::IntoIter, <&mut M as IntoIterator>::IntoIter, <&mut R as IntoIterator>::IntoIter> ⓘwhere
for<'a> &'a mut L: IntoIterator,
for<'a> &'a mut M: IntoIterator,
for<'a> &'a mut R: IntoIterator,
Mutably borrows an Among of Iterators to be an Iterator of Amongs
Unlike iter_mut, this does not require the
Left, Middle and Right iterators to have the same item type.
use among::*;
let mut left: Among<_, Box<[u8]>, Vec<u8>> = Left(["hello"]);
left.factor_iter_mut().for_each(|x| *x.unwrap_left() = "goodbye");
assert_eq!(left, Left(["goodbye"]));
let mut right: Among<[&str; 2], Box<[u8]>, _> = Right(vec![0, 1, 2]);
right.factor_iter_mut().for_each(|x| if let Right(r) = x { *r = -*r; });
assert_eq!(right, Right(vec![0, -1, -2]));
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: Among<&str, &str, &str> = Left("left");
assert_eq!(left.left_or("foo"), "left");
let right: Among<&str, &str, &str> = Right("right");
assert_eq!(right.left_or("left"), "left");
let middle: Among<&str, &str, &str> = Middle("middle");
assert_eq!(middle.left_or("left"), "left");Sourcepub fn left_or_default(self) -> Lwhere
L: Default,
pub fn left_or_default(self) -> Lwhere
L: Default,
Return left or a default
§Examples
let left: Among<String, i32, u32> = Left("left".to_string());
assert_eq!(left.left_or_default(), "left");
let right: Among<String, i32, u32> = Right(42);
assert_eq!(right.left_or_default(), String::default());
let middle: Among<String, i32, u32> = Middle(-42);
assert_eq!(middle.left_or_default(), String::default());Sourcepub fn left_or_else<F, G>(self, f: F, g: G) -> L
pub fn left_or_else<F, G>(self, f: F, g: G) -> L
Returns left value or computes it from a closure
§Examples
let left: Among<String, i32, u32> = Left("3".to_string());
assert_eq!(left.left_or_else(|_| unreachable!(), |_| unreachable!()), "3");
let right: Among<String, i32, u32> = Right(3);
assert_eq!(right.left_or_else(|x| x.to_string(), |x| x.to_string()), "3");
let middle: Among<String, i32, u32> = Middle(3);
assert_eq!(middle.left_or_else(|x| x.to_string(), |x| x.to_string()), "3");Sourcepub fn middle_or(self, other: M) -> M
pub fn middle_or(self, other: M) -> M
Return middle value or given value
Arguments passed to middle_or are eagerly evaluated; if you are passing
the result of a function call, it is recommended to use
middle_or_else, which is lazily evaluated.
§Examples
let right: Among<&str, &str, &str> = Right("right");
assert_eq!(right.middle_or("middle"), "middle");
let left: Among<&str, &str, &str> = Left("left");
assert_eq!(left.middle_or("middle"), "middle");
let middle: Among<&str, &str, &str> = Middle("middle");
assert_eq!(middle.middle_or("foo"), "middle");Sourcepub fn middle_or_default(self) -> Mwhere
M: Default,
pub fn middle_or_default(self) -> Mwhere
M: Default,
Return middle or a default
§Examples
let left: Among<String, i32, u32> = Left("left".to_string());
assert_eq!(left.middle_or_default(), i32::default());
let right: Among<String, i32, u32> = Right(42);
assert_eq!(right.middle_or_default(), i32::default());
let middle: Among<String, i32, u32> = Middle(-42);
assert_eq!(middle.middle_or_default(), -42);Sourcepub fn middle_or_else<F, G>(self, f: F, g: G) -> M
pub fn middle_or_else<F, G>(self, f: F, g: G) -> M
Returns middle value or computes it from a closure
§Examples
let left: Among<String, i32, String> = Left("3".to_string());
assert_eq!(left.middle_or_else(|x| x.parse().unwrap(), |x| x.parse().unwrap()), 3);
let right: Among<String, i32, String> = Right("3".to_string());
assert_eq!(right.middle_or_else(|x| x.parse().unwrap(), |x| x.parse().unwrap()), 3);
let middle: Among<String, i32, String> = Middle(-3);
assert_eq!(middle.middle_or_else(|_| unreachable!(), |_| unreachable!()), -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: Among<&str, &str, &str> = Right("right");
assert_eq!(right.right_or("foo"), "right");
let left: Among<&str, &str, &str> = Left("left");
assert_eq!(left.right_or("right"), "right");
let middle: Among<&str, &str, &str> = Middle("middle");
assert_eq!(middle.right_or("right"), "right");Sourcepub fn right_or_default(self) -> Rwhere
R: Default,
pub fn right_or_default(self) -> Rwhere
R: Default,
Return right or a default
§Examples
let left: Among<String, i32, u32> = Left("left".to_string());
assert_eq!(left.right_or_default(), u32::default());
let right: Among<String, i32, u32> = Right(42);
assert_eq!(right.right_or_default(), 42);
let middle: Among<String, i32, u32> = Middle(-42);
assert_eq!(middle.right_or_default(), u32::default());Sourcepub fn right_or_else<F, G>(self, f: F, g: G) -> R
pub fn right_or_else<F, G>(self, f: F, g: G) -> R
Returns right value or computes it from a closure
§Examples
let left: Among<String, &str, u32> = Left("3".to_string());
assert_eq!(left.right_or_else(|x| x.parse().unwrap(), |x| x.parse().unwrap()), 3);
let right: Among<String, &str, u32> = Right(3);
assert_eq!(right.right_or_else(|_| unreachable!(), |_| unreachable!()), 3);
let middle: Among<String, &str, u32> = Middle("3");
assert_eq!(middle.right_or_else(|x| x.parse().unwrap(), |x| x.parse().unwrap()), 3);Sourcepub fn unwrap_left(self) -> L
pub fn unwrap_left(self) -> L
Sourcepub fn unwrap_middle(self) -> M
pub fn unwrap_middle(self) -> M
Sourcepub fn unwrap_right(self) -> R
pub fn unwrap_right(self) -> R
Sourcepub fn expect_left(self, msg: &str) -> L
pub fn expect_left(self, msg: &str) -> L
Returns the left value
§Examples
let left: Among<_, (), ()> = Left(3);
assert_eq!(left.expect_left("value was not Left"), 3);§Panics
When Among is a Right value
let right: Among<(), (), _> = Right(3);
right.expect_left("value was not Left");When Among is a Middle value
let middle: Among<(), _, ()> = Middle(3);
middle.expect_left("value was not Left");Sourcepub fn expect_middle(self, msg: &str) -> M
pub fn expect_middle(self, msg: &str) -> M
Returns the left value
§Examples
let middle: Among<(), _, ()> = Middle(3);
assert_eq!(middle.expect_middle("value was Middle"), 3);§Panics
When Among is a Right value
let right: Among<(), (), _> = Right(3);
right.expect_middle("value was not Middle");When Among is a Left value
let left: Among<_, (), ()> = Left(3);
left.expect_middle("value was not Middle");Sourcepub fn expect_right(self, msg: &str) -> R
pub fn expect_right(self, msg: &str) -> R
Returns the right value
§Examples
let right: Among<(), (), _> = Right(3);
assert_eq!(right.expect_right("value was not Right"), 3);§Panics
When Among is a Left value
let left: Among<_, (), ()> = Left(3);
left.expect_right("value was not Right");When Among is a Middle value
let middle: Among<(), _, ()> = Middle(3);
middle.expect_right("value was not Right");Sourcepub fn among_into<T>(self) -> T
pub fn among_into<T>(self) -> T
Convert the contained value into T
§Examples
// Both u16 and u32 can be converted to u64.
let left: Among<u16, u32, u64> = Left(3u16);
assert_eq!(left.among_into::<u64>(), 3u64);
let middle: Among<u16, u32, u64> = Middle(3u32);
assert_eq!(middle.among_into::<u64>(), 3u64);
let right: Among<u16, u32, u64> = Right(7u64);
assert_eq!(right.among_into::<u64>(), 7u64);Source§impl<L, M, R> Among<Option<L>, Option<M>, Option<R>>
impl<L, M, R> Among<Option<L>, Option<M>, Option<R>>
Sourcepub fn factor_none(self) -> Option<Among<L, M, R>>
pub fn factor_none(self) -> Option<Among<L, M, R>>
Factors out None from an Among of Option.
use among::*;
let left: Among<_, Option<u32>, Option<String>> = Left(Some(vec![0]));
assert_eq!(left.factor_none(), Some(Left(vec![0])));
let right: Among<Option<Vec<u8>>, Option<u32>, _> = Right(Some(String::new()));
assert_eq!(right.factor_none(), Some(Right(String::new())));
let middle: Among<Option<Vec<u8>>, _, Option<String>> = Middle(Some(123));
assert_eq!(middle.factor_none(), Some(Middle(123)));Source§impl<L, M, R, E> Among<Result<L, E>, Result<M, E>, Result<R, E>>
impl<L, M, R, E> Among<Result<L, E>, Result<M, E>, Result<R, E>>
Sourcepub fn factor_err(self) -> Result<Among<L, M, R>, E>
pub fn factor_err(self) -> Result<Among<L, M, R>, E>
Factors out a homogenous type from an Among of Result.
Here, the homogeneous type is the Err type of the Result.
use among::*;
let left: Among<_, Result<u32, u32>, Result<String, u32>> = Left(Ok(vec![0]));
assert_eq!(left.factor_err(), Ok(Left(vec![0])));
let right: Among<Result<Vec<u8>, u32>, Result<u32, u32>, _> = Right(Ok(String::new()));
assert_eq!(right.factor_err(), Ok(Right(String::new())));
let middle: Among<Result<Vec<u8>, u32>, _, Result<String, u32>> = Middle(Ok(123));
assert_eq!(middle.factor_err(), Ok(Middle(123)));Source§impl<T, L, M, R> Among<Result<T, L>, Result<T, M>, Result<T, R>>
impl<T, L, M, R> Among<Result<T, L>, Result<T, M>, Result<T, R>>
Sourcepub fn factor_ok(self) -> Result<T, Among<L, M, R>>
pub fn factor_ok(self) -> Result<T, Among<L, M, R>>
Factors out a homogenous type from an Among of Result.
Here, the homogeneous type is the Ok type of the Result.
use among::*;
let left: Among<_, Result<u32, i64>, Result<u32, String>> = Left(Err(vec![0]));
assert_eq!(left.factor_ok(), Err(Left(vec![0])));
let right: Among<Result<u32, Vec<u8>>, Result<u32, i64>, _> = Right(Err(String::new()));
assert_eq!(right.factor_ok(), Err(Right(String::new())));
let middle: Among<Result<u32, Vec<u8>>, _, Result<u32, String>> = Middle(Err(-123));
assert_eq!(middle.factor_ok(), Err(Middle(-123)));Source§impl<T, L, M, R> Among<(T, L), (T, M), (T, R)>
impl<T, L, M, R> Among<(T, L), (T, M), (T, R)>
Sourcepub fn factor_first(self) -> (T, Among<L, M, R>)
pub fn factor_first(self) -> (T, Among<L, M, R>)
Factor out a homogeneous type from an among of pairs.
Here, the homogeneous type is the first element of the pairs.
use among::*;
let left: Among<_, (u32, i64), (u32, String)> = Left((123, vec![0]));
assert_eq!(left.factor_first().0, 123);
let right: Among<(u32, Vec<u8>), (u32, i64), _> = Right((123, String::new()));
assert_eq!(right.factor_first().0, 123);
let middle: Among<(u32, Vec<u8>), _, (u32, String)> = Middle((123, vec![0]));
assert_eq!(middle.factor_first().0, 123);Source§impl<T, L, M, R> Among<(L, T), (M, T), (R, T)>
impl<T, L, M, R> Among<(L, T), (M, T), (R, T)>
Sourcepub fn factor_second(self) -> (Among<L, M, R>, T)
pub fn factor_second(self) -> (Among<L, M, R>, T)
Factor out a homogeneous type from an among of pairs.
Here, the homogeneous type is the second element of the pairs.
use among::*;
let left: Among<_, (i64, u32), (String, u32)> = Left((vec![0], 123));
assert_eq!(left.factor_second().1, 123);
let right: Among<(Vec<u8>, u32), (i64, u32), _> = Right((String::new(), 123));
assert_eq!(right.factor_second().1, 123);
let middle: Among<(Vec<u8>, u32), _, (String, u32)> = Middle((-1, 123));
assert_eq!(middle.factor_second().1, 123);Source§impl<T> Among<T, T, T>
impl<T> Among<T, T, T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Extract the value of an among over two equivalent types.
use among::*;
let left: Among<_, _, u32> = Left(123);
assert_eq!(left.into_inner(), 123);
let right: Among<u32, _, _> = Right(123);
assert_eq!(right.into_inner(), 123);
let middle: Among<_, u32, _> = Middle(123);
assert_eq!(middle.into_inner(), 123);Source§impl<L, M, R> Among<&L, &M, &R>
impl<L, M, R> Among<&L, &M, &R>
Trait Implementations§
Source§impl<L, M, R> AsMut<CStr> for Among<L, M, R>
Available on crate feature std only.Requires crate feature std.
impl<L, M, R> AsMut<CStr> for Among<L, M, R>
std only.Requires crate feature std.
Source§impl<L, M, R> AsMut<OsStr> for Among<L, M, R>
Available on crate feature std only.Requires crate feature std.
impl<L, M, R> AsMut<OsStr> for Among<L, M, R>
std only.Requires crate feature std.
Source§impl<L, M, R> AsMut<Path> for Among<L, M, R>
Available on crate feature std only.Requires crate feature std.
impl<L, M, R> AsMut<Path> for Among<L, M, R>
std only.Requires crate feature std.
Source§impl<L, M, R, Target> AsMut<Target> for Among<L, M, R>
impl<L, M, R, Target> AsMut<Target> for Among<L, M, R>
Source§fn as_mut(&mut self) -> &mut Target
fn as_mut(&mut self) -> &mut Target
Source§impl<L, M, R> AsRef<CStr> for Among<L, M, R>
Available on crate feature std only.Requires crate feature std.
impl<L, M, R> AsRef<CStr> for Among<L, M, R>
std only.Requires crate feature std.
Source§impl<L, M, R> AsRef<OsStr> for Among<L, M, R>
Available on crate feature std only.Requires crate feature std.
impl<L, M, R> AsRef<OsStr> for Among<L, M, R>
std only.Requires crate feature std.
Source§impl<L, M, R> AsRef<Path> for Among<L, M, R>
Available on crate feature std only.Requires crate feature std.
impl<L, M, R> AsRef<Path> for Among<L, M, R>
std only.Requires crate feature std.
Source§impl<L, M, R> AsyncBufRead for Among<L, M, R>
Available on crate features futures-io and std only.
impl<L, M, R> AsyncBufRead for Among<L, M, R>
futures-io and std only.Source§impl<L, M, R> AsyncBufRead for Among<L, M, R>
Available on crate feature tokio only.
impl<L, M, R> AsyncBufRead for Among<L, M, R>
tokio only.Source§impl<L, M, R> AsyncRead for Among<L, M, R>
Available on crate features futures-io and std only.
impl<L, M, R> AsyncRead for Among<L, M, R>
futures-io and std only.Source§impl<L, M, R> AsyncSeek for Among<L, M, R>
Available on crate features futures-io and std only.
impl<L, M, R> AsyncSeek for Among<L, M, R>
futures-io and std only.Source§impl<L, M, R> AsyncWrite for Among<L, M, R>
Available on crate features futures-io and std only.
impl<L, M, R> AsyncWrite for Among<L, M, R>
futures-io and std only.Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
buf into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Source§impl<L, M, R> AsyncWrite for Among<L, M, R>
Available on crate feature tokio only.
impl<L, M, R> AsyncWrite for Among<L, M, R>
tokio only.Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
buf into the object. Read moreSource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Source§fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
Source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>
poll_write, except that it writes from a slice of buffers. Read moreSource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
poll_write_vectored
implementation. Read moreSource§impl<L, M, R> BufRead for Among<L, M, R>
Available on crate features std only.Requires crate feature "std"
impl<L, M, R> BufRead for Among<L, M, R>
std only.Requires crate feature "std"
Source§fn fill_buf(&mut self) -> Result<&[u8]>
fn fill_buf(&mut self) -> Result<&[u8]>
Read methods, if empty. Read moreSource§fn consume(&mut self, amt: usize)
fn consume(&mut self, amt: usize)
amount of additional bytes from the internal buffer as having been read.
Subsequent calls to read only return bytes that have not been marked as read. Read moreSource§fn read_line(&mut self, buf: &mut String) -> Result<usize>
fn read_line(&mut self, buf: &mut String) -> Result<usize>
0xA byte) is reached, and append
them to the provided String buffer. Read moreSource§fn has_data_left(&mut self) -> Result<bool, Error>
fn has_data_left(&mut self) -> Result<bool, Error>
buf_read_has_data_left)read. Read more1.83.0 · Source§fn skip_until(&mut self, byte: u8) -> Result<usize, Error>
fn skip_until(&mut self, byte: u8) -> Result<usize, Error>
byte or EOF is reached. Read moreSource§impl<'de, L, M, R> Deserialize<'de> for Among<L, M, R>
impl<'de, L, M, R> Deserialize<'de> for Among<L, M, R>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<L, M, R> DoubleEndedIterator for Among<L, M, R>where
L: DoubleEndedIterator,
M: DoubleEndedIterator<Item = L::Item>,
R: DoubleEndedIterator<Item = L::Item>,
impl<L, M, R> DoubleEndedIterator for Among<L, M, R>where
L: DoubleEndedIterator,
M: DoubleEndedIterator<Item = L::Item>,
R: DoubleEndedIterator<Item = L::Item>,
Source§fn next_back(&mut self) -> Option<Self::Item>
fn next_back(&mut self) -> Option<Self::Item>
Source§fn nth_back(&mut self, n: usize) -> Option<Self::Item>
fn nth_back(&mut self, n: usize) -> Option<Self::Item>
nth element from the end of the iterator. Read moreSource§fn rfold<Acc, G>(self, init: Acc, f: G) -> Acc
fn rfold<Acc, G>(self, init: Acc, f: G) -> Acc
Source§fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
Source§impl<L, M, R> Error for Among<L, M, R>
Available on crate features std only.Among implements Error if all of L, M and R implement it.
impl<L, M, R> Error for Among<L, M, R>
std only.Among implements Error if all of L, M and R implement it.
Requires crate feature "std"
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl<L, M, R> ExactSizeIterator for Among<L, M, R>where
L: ExactSizeIterator,
M: ExactSizeIterator<Item = L::Item>,
R: ExactSizeIterator<Item = L::Item>,
impl<L, M, R> ExactSizeIterator for Among<L, M, R>where
L: ExactSizeIterator,
M: ExactSizeIterator<Item = L::Item>,
R: ExactSizeIterator<Item = L::Item>,
Source§impl<L, M, R, A> Extend<A> for Among<L, M, R>
impl<L, M, R, A> Extend<A> for Among<L, M, R>
Source§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = A>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = A>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<A, B, C> From<Either<A, Either<B, C>>> for Among<A, B, C>
Available on crate feature either only.
impl<A, B, C> From<Either<A, Either<B, C>>> for Among<A, B, C>
either only.Source§impl<A, B, C> From<Either<Either<A, B>, C>> for Among<A, B, C>
Available on crate feature either only.
impl<A, B, C> From<Either<Either<A, B>, C>> for Among<A, B, C>
either only.Source§impl<L, M, R> Future for Among<L, M, R>
Among<L, M, R> is a future if both L, M and R are futures.
impl<L, M, R> Future for Among<L, M, R>
Among<L, M, R> is a future if both L, M and R are futures.
Source§impl<L, M, R> Iterator for Among<L, M, R>
Among<L, M, R> is an iterator if both L and R are iterators.
impl<L, M, R> Iterator for Among<L, M, R>
Among<L, M, R> is an iterator if both L and R are iterators.
Source§fn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Source§fn fold<Acc, G>(self, init: Acc, f: G) -> Acc
fn fold<Acc, G>(self, init: Acc, f: G) -> Acc
Source§fn count(self) -> usize
fn count(self) -> usize
Source§fn last(self) -> Option<Self::Item>
fn last(self) -> Option<Self::Item>
Source§fn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
nth element of the iterator. Read moreSource§fn collect<B>(self) -> Bwhere
B: FromIterator<Self::Item>,
fn collect<B>(self) -> Bwhere
B: FromIterator<Self::Item>,
Source§fn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Source§fn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
Source§fn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
Source§fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Source§fn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Source§fn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
Source§fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
iter_next_chunk)N values. Read moreSource§fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by)n elements. Read more1.28.0 · Source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
1.0.0 · Source§fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
1.0.0 · Source§fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>where
Self: Sized,
U: IntoIterator,
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
iter_intersperse)separator between adjacent
items of the original iterator. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
iter_intersperse)separator
between adjacent items of the original iterator. Read more1.0.0 · Source§fn map<B, F>(self, f: F) -> Map<Self, F>
fn map<B, F>(self, f: F) -> Map<Self, F>
1.0.0 · Source§fn filter<P>(self, predicate: P) -> Filter<Self, P>
fn filter<P>(self, predicate: P) -> Filter<Self, P>
1.0.0 · Source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
1.0.0 · Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
1.0.0 · Source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
1.0.0 · Source§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
1.57.0 · Source§fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
1.0.0 · Source§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n elements. Read more1.0.0 · Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n elements, or fewer
if the underlying iterator ends sooner. Read more1.0.0 · Source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
1.29.0 · Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
iter_map_windows)f for each contiguous window of size N over
self and returns an iterator over the outputs of f. Like slice::windows(),
the windows during mapping overlap as well. Read more1.0.0 · Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Iterator. Read moreSource§fn try_collect<B>(
&mut self,
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B>( &mut self, ) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect)Source§fn collect_into<E>(self, collection: &mut E) -> &mut E
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into)Source§fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
iter_partition_in_place)true precede all those that return false.
Returns the number of true elements found. Read moreSource§fn is_partitioned<P>(self, predicate: P) -> bool
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned)true precede all those that return false. Read more1.27.0 · Source§fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
1.27.0 · Source§fn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
1.51.0 · Source§fn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Source§fn try_reduce<R>(
&mut self,
f: impl FnMut(Self::Item, Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
fn try_reduce<R>( &mut self, f: impl FnMut(Self::Item, Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce)Source§fn try_find<R>(
&mut self,
f: impl FnMut(&Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
fn try_find<R>( &mut self, f: impl FnMut(&Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find)1.0.0 · Source§fn rposition<P>(&mut self, predicate: P) -> Option<usize>
fn rposition<P>(&mut self, predicate: P) -> Option<usize>
1.0.0 · Source§fn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
1.0.0 · Source§fn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
1.6.0 · Source§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
1.6.0 · Source§fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 · Source§fn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
1.0.0 · Source§fn rev(self) -> Rev<Self>where
Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self>where
Self: Sized + DoubleEndedIterator,
1.0.0 · Source§fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
1.36.0 · Source§fn copied<'a, T>(self) -> Copied<Self>
fn copied<'a, T>(self) -> Copied<Self>
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>where
Self: Sized,
iter_array_chunks)N elements of the iterator at a time. Read more1.11.0 · Source§fn product<P>(self) -> P
fn product<P>(self) -> P
Source§fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
iter_order_by)Iterator with those
of another with respect to the specified comparison function. Read more1.5.0 · Source§fn partial_cmp<I>(self, other: I) -> Option<Ordering>
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
PartialOrd elements of
this Iterator with those of another. The comparison works like short-circuit
evaluation, returning a result without comparing the remaining elements.
As soon as an order can be determined, the evaluation stops and a result is returned. Read moreSource§fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
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
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by)Iterator with those
of another with respect to the specified comparison function. Read moreSource§fn eq_by<I, F>(self, other: I, eq: F) -> bool
fn eq_by<I, F>(self, other: I, eq: F) -> bool
iter_order_by)1.5.0 · Source§fn lt<I>(self, other: I) -> bool
fn lt<I>(self, other: I) -> bool
Iterator are lexicographically
less than those of another. Read more1.5.0 · Source§fn le<I>(self, other: I) -> bool
fn le<I>(self, other: I) -> bool
Iterator are lexicographically
less or equal to those of another. Read more1.5.0 · Source§fn gt<I>(self, other: I) -> bool
fn gt<I>(self, other: I) -> bool
Iterator are lexicographically
greater than those of another. Read more1.5.0 · Source§fn ge<I>(self, other: I) -> bool
fn ge<I>(self, other: I) -> bool
Iterator are lexicographically
greater than or equal to those of another. Read more1.82.0 · Source§fn is_sorted(self) -> bool
fn is_sorted(self) -> bool
1.82.0 · Source§fn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
1.82.0 · Source§fn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
Source§impl<L: Ord, M: Ord, R: Ord> Ord for Among<L, M, R>
impl<L: Ord, M: Ord, R: Ord> Ord for Among<L, M, R>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<L: PartialOrd, M: PartialOrd, R: PartialOrd> PartialOrd for Among<L, M, R>
impl<L: PartialOrd, M: PartialOrd, R: PartialOrd> PartialOrd for Among<L, M, R>
Source§impl<L, M, R> Read for Among<L, M, R>
Available on crate features std only.Among<L, M, R> implements Read if both L and R do.
impl<L, M, R> Read for Among<L, M, R>
std only.Among<L, M, R> implements Read if both L and R do.
Requires crate feature "std"
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
buf. Read moreSource§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize>
buf. Read moreSource§fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize>
buf. Read more1.36.0 · Source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moreSource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)Source§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)Source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)cursor. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read. Read more1.0.0 · Source§fn chain<R>(self, next: R) -> Chain<Self, R>
fn chain<R>(self, next: R) -> Chain<Self, R>
Source§impl<L, M, R> Seek for Among<L, M, R>
Available on crate features std only.Among<L, M, R> implements Seek if both L and R do.
impl<L, M, R> Seek for Among<L, M, R>
std only.Among<L, M, R> implements Seek if both L and R do.
Requires crate feature "std"
Source§fn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
1.55.0 · Source§fn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Source§fn stream_len(&mut self) -> Result<u64, Error>
fn stream_len(&mut self) -> Result<u64, Error>
seek_stream_len)Source§impl<L, M, R> Write for Among<L, M, R>
Available on crate features std only.Among<L, M, R> implements Write if all of L, M and R do.
impl<L, M, R> Write for Among<L, M, R>
std only.Among<L, M, R> implements Write if all of L, M and R do.
Requires crate feature "std"
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
Source§fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)impl<L: Copy, M: Copy, R: Copy> Copy for Among<L, M, R>
impl<L: Eq, M: Eq, R: Eq> Eq for Among<L, M, R>
impl<L, M, R> FusedIterator for Among<L, M, R>
impl<L, M, R> StructuralPartialEq for Among<L, M, R>
Auto Trait Implementations§
impl<L, M, R> Freeze for Among<L, M, R>
impl<L, M, R> RefUnwindSafe for Among<L, M, R>
impl<L, M, R> Send for Among<L, M, R>
impl<L, M, R> Sync for Among<L, M, R>
impl<L, M, R> Unpin for Among<L, M, R>
impl<L, M, R> UnwindSafe for Among<L, M, R>
Blanket Implementations§
Source§impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
impl<R> AsyncBufReadExt for Rwhere
R: AsyncBufRead + ?Sized,
Source§fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self>where
Self: Unpin,
fn read_until<'a>(
&'a mut self,
byte: u8,
buf: &'a mut Vec<u8>,
) -> ReadUntil<'a, Self>where
Self: Unpin,
Source§fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self>where
Self: Unpin,
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLine<'a, Self>where
Self: Unpin,
Source§fn split(self, byte: u8) -> Split<Self>
fn split(self, byte: u8) -> Split<Self>
byte. Read moreSource§fn fill_buf(&mut self) -> FillBuf<'_, Self>where
Self: Unpin,
fn fill_buf(&mut self) -> FillBuf<'_, Self>where
Self: Unpin,
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
Source§fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
buf. Read moreSource§fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
Source§fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
Source§fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
Source§fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
Source§fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
Source§fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
Source§fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
Source§fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
Source§fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
Source§fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
Source§fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
Source§fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
Source§fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
Source§fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
Source§fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
Source§fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
Source§fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
Source§fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
Source§fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
Source§fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
Source§fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
Source§fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
Source§fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
buf. Read moreSource§impl<S> AsyncSeekExt for S
impl<S> AsyncSeekExt for S
Source§fn seek(&mut self, pos: SeekFrom) -> Seek<'_, Self>where
Self: Unpin,
fn seek(&mut self, pos: SeekFrom) -> Seek<'_, Self>where
Self: Unpin,
Source§fn rewind(&mut self) -> Seek<'_, Self>where
Self: Unpin,
fn rewind(&mut self) -> Seek<'_, Self>where
Self: Unpin,
Source§fn stream_position(&mut self) -> Seek<'_, Self>where
Self: Unpin,
fn stream_position(&mut self) -> Seek<'_, Self>where
Self: Unpin,
Source§impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
Source§fn write<'a>(&'a mut self, src: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
fn write<'a>(&'a mut self, src: &'a [u8]) -> Write<'a, Self>where
Self: Unpin,
Source§fn write_vectored<'a, 'b>(
&'a mut self,
bufs: &'a [IoSlice<'b>],
) -> WriteVectored<'a, 'b, Self>where
Self: Unpin,
fn write_vectored<'a, 'b>(
&'a mut self,
bufs: &'a [IoSlice<'b>],
) -> WriteVectored<'a, 'b, Self>where
Self: Unpin,
Source§fn write_buf<'a, B>(&'a mut self, src: &'a mut B) -> WriteBuf<'a, Self, B>
fn write_buf<'a, B>(&'a mut self, src: &'a mut B) -> WriteBuf<'a, Self, B>
Source§fn write_all_buf<'a, B>(
&'a mut self,
src: &'a mut B,
) -> WriteAllBuf<'a, Self, B>
fn write_all_buf<'a, B>( &'a mut self, src: &'a mut B, ) -> WriteAllBuf<'a, Self, B>
Source§fn write_all<'a>(&'a mut self, src: &'a [u8]) -> WriteAll<'a, Self>where
Self: Unpin,
fn write_all<'a>(&'a mut self, src: &'a [u8]) -> WriteAll<'a, Self>where
Self: Unpin,
Source§fn write_u8(&mut self, n: u8) -> WriteU8<&mut Self>where
Self: Unpin,
fn write_u8(&mut self, n: u8) -> WriteU8<&mut Self>where
Self: Unpin,
Source§fn write_i8(&mut self, n: i8) -> WriteI8<&mut Self>where
Self: Unpin,
fn write_i8(&mut self, n: i8) -> WriteI8<&mut Self>where
Self: Unpin,
Source§fn write_u16(&mut self, n: u16) -> WriteU16<&mut Self>where
Self: Unpin,
fn write_u16(&mut self, n: u16) -> WriteU16<&mut Self>where
Self: Unpin,
Source§fn write_i16(&mut self, n: i16) -> WriteI16<&mut Self>where
Self: Unpin,
fn write_i16(&mut self, n: i16) -> WriteI16<&mut Self>where
Self: Unpin,
Source§fn write_u32(&mut self, n: u32) -> WriteU32<&mut Self>where
Self: Unpin,
fn write_u32(&mut self, n: u32) -> WriteU32<&mut Self>where
Self: Unpin,
Source§fn write_i32(&mut self, n: i32) -> WriteI32<&mut Self>where
Self: Unpin,
fn write_i32(&mut self, n: i32) -> WriteI32<&mut Self>where
Self: Unpin,
Source§fn write_u64(&mut self, n: u64) -> WriteU64<&mut Self>where
Self: Unpin,
fn write_u64(&mut self, n: u64) -> WriteU64<&mut Self>where
Self: Unpin,
Source§fn write_i64(&mut self, n: i64) -> WriteI64<&mut Self>where
Self: Unpin,
fn write_i64(&mut self, n: i64) -> WriteI64<&mut Self>where
Self: Unpin,
Source§fn write_u128(&mut self, n: u128) -> WriteU128<&mut Self>where
Self: Unpin,
fn write_u128(&mut self, n: u128) -> WriteU128<&mut Self>where
Self: Unpin,
Source§fn write_i128(&mut self, n: i128) -> WriteI128<&mut Self>where
Self: Unpin,
fn write_i128(&mut self, n: i128) -> WriteI128<&mut Self>where
Self: Unpin,
Source§fn write_f32(&mut self, n: f32) -> WriteF32<&mut Self>where
Self: Unpin,
fn write_f32(&mut self, n: f32) -> WriteF32<&mut Self>where
Self: Unpin,
Source§fn write_f64(&mut self, n: f64) -> WriteF64<&mut Self>where
Self: Unpin,
fn write_f64(&mut self, n: f64) -> WriteF64<&mut Self>where
Self: Unpin,
Source§fn write_u16_le(&mut self, n: u16) -> WriteU16Le<&mut Self>where
Self: Unpin,
fn write_u16_le(&mut self, n: u16) -> WriteU16Le<&mut Self>where
Self: Unpin,
Source§fn write_i16_le(&mut self, n: i16) -> WriteI16Le<&mut Self>where
Self: Unpin,
fn write_i16_le(&mut self, n: i16) -> WriteI16Le<&mut Self>where
Self: Unpin,
Source§fn write_u32_le(&mut self, n: u32) -> WriteU32Le<&mut Self>where
Self: Unpin,
fn write_u32_le(&mut self, n: u32) -> WriteU32Le<&mut Self>where
Self: Unpin,
Source§fn write_i32_le(&mut self, n: i32) -> WriteI32Le<&mut Self>where
Self: Unpin,
fn write_i32_le(&mut self, n: i32) -> WriteI32Le<&mut Self>where
Self: Unpin,
Source§fn write_u64_le(&mut self, n: u64) -> WriteU64Le<&mut Self>where
Self: Unpin,
fn write_u64_le(&mut self, n: u64) -> WriteU64Le<&mut Self>where
Self: Unpin,
Source§fn write_i64_le(&mut self, n: i64) -> WriteI64Le<&mut Self>where
Self: Unpin,
fn write_i64_le(&mut self, n: i64) -> WriteI64Le<&mut Self>where
Self: Unpin,
Source§fn write_u128_le(&mut self, n: u128) -> WriteU128Le<&mut Self>where
Self: Unpin,
fn write_u128_le(&mut self, n: u128) -> WriteU128Le<&mut Self>where
Self: Unpin,
Source§fn write_i128_le(&mut self, n: i128) -> WriteI128Le<&mut Self>where
Self: Unpin,
fn write_i128_le(&mut self, n: i128) -> WriteI128Le<&mut Self>where
Self: Unpin,
Source§fn write_f32_le(&mut self, n: f32) -> WriteF32Le<&mut Self>where
Self: Unpin,
fn write_f32_le(&mut self, n: f32) -> WriteF32Le<&mut Self>where
Self: Unpin,
Source§fn write_f64_le(&mut self, n: f64) -> WriteF64Le<&mut Self>where
Self: Unpin,
fn write_f64_le(&mut self, n: f64) -> WriteF64Le<&mut Self>where
Self: Unpin,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoAmong for T
impl<T> IntoAmong for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more