Trait IntoEither
pub trait IntoEither: Sized
Provides methods for converting a type Self into either a Left or Right
variant of Either<Self, Self>.
The into_either method takes a bool to determine
whether to convert to Left or Right.
The into_either_with method takes a
predicate function to determine whether to convert to Left or Right.
Provided Methods
fn into_either(self, into_left: bool) -> Either<Self, Self>Converts
selfinto aLeftvariant ofEither<Self, Self>ifinto_leftistrue. Convertsselfinto aRightvariant ofEither<Self, Self>otherwise.Examples
use ; let x = 0; assert_eq!; assert_eq!;fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> where F: FnOnce(&Self) -> bool,Converts
selfinto aLeftvariant ofEither<Self, Self>ifinto_left(&self)returnstrue. Convertsselfinto aRightvariant ofEither<Self, Self>otherwise.Examples
use ; let x = 0; assert_eq!; assert_eq!;
Implementors
impl<T> IntoEither for Either<L, R>impl<T> IntoEither for IterEither<L, R>impl<T> IntoEither for T