pub struct PairWithFirstBrand<First>(/* private fields */);Expand description
Brand for the partially-applied form of crate::types::Pair with the first value filled in.
Trait Implementations§
Source§impl<First: Clone + Semigroup + 'static> ApplyFirst for PairWithFirstBrand<First>
impl<First: Clone + Semigroup + 'static> ApplyFirst for PairWithFirstBrand<First>
Source§fn apply_first<'a, A: 'a + Clone, B: 'a + Clone>(
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
fb: <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
fn apply_first<'a, A: 'a + Clone, B: 'a + Clone>( fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, fb: <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>, ) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
Source§impl<First: Clone + Semigroup + 'static> ApplySecond for PairWithFirstBrand<First>
impl<First: Clone + Semigroup + 'static> ApplySecond for PairWithFirstBrand<First>
Source§fn apply_second<'a, A: 'a + Clone, B: 'a + Clone>(
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
fb: <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
fn apply_second<'a, A: 'a + Clone, B: 'a + Clone>( fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, fb: <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>, ) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
Source§impl<First: Clone> Clone for PairWithFirstBrand<First>
impl<First: Clone> Clone for PairWithFirstBrand<First>
Source§fn clone(&self) -> PairWithFirstBrand<First>
fn clone(&self) -> PairWithFirstBrand<First>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<First: Debug> Debug for PairWithFirstBrand<First>
impl<First: Debug> Debug for PairWithFirstBrand<First>
Source§impl<First: Default> Default for PairWithFirstBrand<First>
impl<First: Default> Default for PairWithFirstBrand<First>
Source§fn default() -> PairWithFirstBrand<First>
fn default() -> PairWithFirstBrand<First>
Source§impl<First: 'static> Foldable for PairWithFirstBrand<First>
impl<First: 'static> Foldable for PairWithFirstBrand<First>
Source§fn fold_right<'a, FnBrand, Func, A: 'a, B: 'a>(
func: Func,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
Func: Fn(A, B) -> B + 'a,
FnBrand: ClonableFn + 'a,
fn fold_right<'a, FnBrand, Func, A: 'a, B: 'a>(
func: Func,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
Func: Fn(A, B) -> B + 'a,
FnBrand: ClonableFn + 'a,
Folds the pair from the right (over second).
This method performs a right-associative fold of the pair (over second).
§Type Signature
forall a b t. Foldable (Pair t) => ((a, b) -> b, b, Pair t a) -> b
§Type Parameters
FnBrand: The brand of the clonable function to use.Func: The type of the folding function.A: The type of the elements in the structure.B: The type of the accumulator.
§Parameters
func: The folding function.initial: The initial value.fa: The pair to fold.
§Returns
func(a, initial).
§Examples
use fp_library::classes::foldable::fold_right;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::brands::RcFnBrand;
assert_eq!(fold_right::<RcFnBrand, PairWithFirstBrand<()>, _, _, _>(|x, acc| x + acc, 0, Pair((), 5)), 5);Source§fn fold_left<'a, FnBrand, Func, A: 'a, B: 'a>(
func: Func,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
Func: Fn(B, A) -> B + 'a,
FnBrand: ClonableFn + 'a,
fn fold_left<'a, FnBrand, Func, A: 'a, B: 'a>(
func: Func,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
Func: Fn(B, A) -> B + 'a,
FnBrand: ClonableFn + 'a,
Folds the pair from the left (over second).
This method performs a left-associative fold of the pair (over second).
§Type Signature
forall a b t. Foldable (Pair t) => ((b, a) -> b, b, Pair t a) -> b
§Type Parameters
FnBrand: The brand of the clonable function to use.Func: The type of the folding function.A: The type of the elements in the structure.B: The type of the accumulator.
§Parameters
func: The function to apply to the accumulator and each element.initial: The initial value of the accumulator.fa: The pair to fold.
§Returns
func(initial, a).
§Examples
use fp_library::classes::foldable::fold_left;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::brands::RcFnBrand;
assert_eq!(fold_left::<RcFnBrand, PairWithFirstBrand<()>, _, _, _>(|acc, x| acc + x, 0, Pair((), 5)), 5);Source§fn fold_map<'a, FnBrand, Func, A: 'a, M>(
func: Func,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> M
fn fold_map<'a, FnBrand, Func, A: 'a, M>( func: Func, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> M
Maps the value to a monoid and returns it (over second).
This method maps the element of the pair to a monoid and then returns it (over second).
§Type Signature
forall a m t. (Foldable (Pair t), Monoid m) => ((a) -> m, Pair t a) -> m
§Type Parameters
FnBrand: The brand of the clonable function to use.Func: The type of the mapping function.A: The type of the elements in the structure.M: The type of the monoid.
§Parameters
func: The mapping function.fa: The pair to fold.
§Returns
func(a).
§Examples
use fp_library::classes::foldable::fold_map;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::types::string;
use fp_library::brands::RcFnBrand;
assert_eq!(
fold_map::<RcFnBrand, PairWithFirstBrand<()>, _, _, _>(|x: i32| x.to_string(), Pair((), 5)),
"5".to_string()
);Source§impl<First: 'static> Functor for PairWithFirstBrand<First>
impl<First: 'static> Functor for PairWithFirstBrand<First>
Source§fn map<'a, F, A: 'a, B: 'a>(
f: F,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>where
F: Fn(A) -> B + 'a,
fn map<'a, F, A: 'a, B: 'a>(
f: F,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>where
F: Fn(A) -> B + 'a,
Maps a function over the second value in the pair.
This method applies a function to the second value inside the pair, producing a new pair with the transformed second value. The first value remains unchanged.
§Type Signature
forall a b t. Functor (Pair t) => (a -> b, Pair t a) -> Pair t b
§Type Parameters
F: The type of the function to apply.A: The type of the second value.B: The type of the result of applying the function.
§Parameters
f: The function to apply to the second value.fa: The pair to map over.
§Returns
A new pair containing the result of applying the function to the second value.
§Examples
use fp_library::classes::functor::map;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
assert_eq!(map::<PairWithFirstBrand<_>, _, _, _>(|x: i32| x * 2, Pair(1, 5)), Pair(1, 10));Source§impl<First: Hash> Hash for PairWithFirstBrand<First>
impl<First: Hash> Hash for PairWithFirstBrand<First>
Source§impl<First: 'static> Kind_cdc7cd43dac7585f for PairWithFirstBrand<First>
Generated implementation of Kind_cdc7cd43dac7585f for PairWithFirstBrand < First >.
impl<First: 'static> Kind_cdc7cd43dac7585f for PairWithFirstBrand<First>
Generated implementation of Kind_cdc7cd43dac7585f for PairWithFirstBrand < First >.
Source§impl<First> Lift for PairWithFirstBrand<First>
impl<First> Lift for PairWithFirstBrand<First>
Source§fn lift2<'a, F, A, B, C>(
f: F,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
fb: <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, C>
fn lift2<'a, F, A, B, C>( f: F, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, fb: <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>, ) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, C>
Lifts a binary function into the pair context (over second).
This method lifts a binary function to operate on the second values within the pair context. The first values are combined using their Semigroup implementation.
§Type Signature
forall a b c t. (Lift (Pair t), Semigroup t) => ((a, b) -> c, Pair t a, Pair t b) -> Pair t c
§Type Parameters
F: The type of the binary function.A: The type of the first second value.B: The type of the second second value.C: The type of the result second value.
§Parameters
f: The binary function to apply to the second values.fa: The first pair.fb: The second pair.
§Returns
A new pair where the first values are combined using Semigroup::append and the second values are combined using f.
§Examples
use fp_library::classes::lift::lift2;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::types::string;
assert_eq!(
lift2::<PairWithFirstBrand<String>, _, _, _, _>(|x, y| x + y, Pair("a".to_string(), 1), Pair("b".to_string(), 2)),
Pair("ab".to_string(), 3)
);Source§impl<First: Ord> Ord for PairWithFirstBrand<First>
impl<First: Ord> Ord for PairWithFirstBrand<First>
Source§fn cmp(&self, other: &PairWithFirstBrand<First>) -> Ordering
fn cmp(&self, other: &PairWithFirstBrand<First>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<First: 'static, FnBrand: SendClonableFn> ParFoldable<FnBrand> for PairWithFirstBrand<First>
impl<First: 'static, FnBrand: SendClonableFn> ParFoldable<FnBrand> for PairWithFirstBrand<First>
Source§fn par_fold_map<'a, A, M>(
func: <FnBrand as SendClonableFn>::SendOf<'a, A, M>,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> M
fn par_fold_map<'a, A, M>( func: <FnBrand as SendClonableFn>::SendOf<'a, A, M>, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> M
Maps the value to a monoid and returns it in parallel (over second).
This method maps the element of the pair to a monoid and then returns it (over second). The mapping operation may be executed in parallel.
§Type Signature
forall a m t. (ParFoldable (Pair t), Monoid m, Send m, Sync m) => (f a m, Pair t a) -> m
§Type Parameters
FnBrand: The brand of thread-safe function to use (must implementSendClonableFn).A: The element type (must beSend + Sync).M: The monoid type (must beSend + Sync).
§Parameters
func: The thread-safe function to map each element to a monoid.fa: The pair to fold.
§Returns
The combined monoid value.
§Examples
use fp_library::classes::par_foldable::par_fold_map;
use fp_library::brands::{PairWithFirstBrand, ArcFnBrand};
use fp_library::classes::send_clonable_fn::SendClonableFn;
use fp_library::types::{Pair, string};
let x = Pair("a".to_string(), 1);
let f = <ArcFnBrand as SendClonableFn>::new_send(|x: i32| x.to_string());
assert_eq!(
par_fold_map::<ArcFnBrand, PairWithFirstBrand<String>, _, _>(f, x),
"1".to_string()
);Source§fn par_fold_right<'a, A, B>(
func: <FnBrand as SendClonableFn>::SendOf<'a, (A, B), B>,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> B
fn par_fold_right<'a, A, B>( func: <FnBrand as SendClonableFn>::SendOf<'a, (A, B), B>, initial: B, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> B
Folds the pair from the right in parallel (over second).
This method folds the pair by applying a function from right to left, potentially in parallel (over second).
§Type Signature
forall a b t. ParFoldable (Pair t) => (f (a, b) b, b, Pair t a) -> b
§Type Parameters
FnBrand: The brand of thread-safe function to use.A: The element type (must beSend + Sync).B: The accumulator type (must beSend + Sync).
§Parameters
func: The thread-safe function to apply to each element and the accumulator.initial: The initial value.fa: The pair to fold.
§Returns
The final accumulator value.
§Examples
use fp_library::classes::par_foldable::par_fold_right;
use fp_library::brands::{PairWithFirstBrand, ArcFnBrand};
use fp_library::classes::send_clonable_fn::SendClonableFn;
use fp_library::types::Pair;
let x = Pair("a".to_string(), 1);
let f = <ArcFnBrand as SendClonableFn>::new_send(|(a, b): (i32, i32)| a + b);
assert_eq!(par_fold_right::<ArcFnBrand, PairWithFirstBrand<String>, _, _>(f, 10, x), 11);Source§impl<First: PartialEq> PartialEq for PairWithFirstBrand<First>
impl<First: PartialEq> PartialEq for PairWithFirstBrand<First>
Source§impl<First: PartialOrd> PartialOrd for PairWithFirstBrand<First>
impl<First: PartialOrd> PartialOrd for PairWithFirstBrand<First>
Source§impl<First> Pointed for PairWithFirstBrand<First>
impl<First> Pointed for PairWithFirstBrand<First>
Source§fn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
fn pure<'a, A: 'a>(a: A) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>
Wraps a value in a pair (with empty first).
This method wraps a value in a pair, using the Monoid::empty() value for the first element.
§Type Signature
forall a t. (Pointed (Pair t), Monoid t) => a -> Pair t a
§Type Parameters
A: The type of the value to wrap.
§Parameters
a: The value to wrap.
§Returns
A pair containing the empty value of the first type and a.
§Examples
use fp_library::classes::pointed::pure;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::types::string;
assert_eq!(pure::<PairWithFirstBrand<String>, _>(5), Pair("".to_string(), 5));Source§impl<First> Semiapplicative for PairWithFirstBrand<First>
impl<First> Semiapplicative for PairWithFirstBrand<First>
Source§fn apply<'a, FnBrand: 'a + ClonableFn, A: 'a + Clone, B: 'a>(
ff: <Self as Kind_cdc7cd43dac7585f>::Of<'a, <FnBrand as ClonableFn>::Of<'a, A, B>>,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
fn apply<'a, FnBrand: 'a + ClonableFn, A: 'a + Clone, B: 'a>( ff: <Self as Kind_cdc7cd43dac7585f>::Of<'a, <FnBrand as ClonableFn>::Of<'a, A, B>>, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
Applies a wrapped function to a wrapped value (over second).
This method applies a function wrapped in a pair to a value wrapped in a pair. The first values are combined using their Semigroup implementation.
§Type Signature
forall a b t. (Semiapplicative (Pair t), Semigroup t) => (Pair t (a -> b), Pair t a) -> Pair t b
§Type Parameters
FnBrand: The brand of the clonable function wrapper.A: The type of the input value.B: The type of the output value.
§Parameters
ff: The pair containing the function.fa: The pair containing the value.
§Returns
A new pair where the first values are combined and the function is applied to the second value.
§Examples
use fp_library::classes::semiapplicative::apply;
use fp_library::classes::clonable_fn::ClonableFn;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::brands::RcFnBrand;
use fp_library::types::string;
use std::rc::Rc;
let f = Pair("a".to_string(), <RcFnBrand as ClonableFn>::new(|x: i32| x * 2));
assert_eq!(apply::<RcFnBrand, PairWithFirstBrand<String>, _, _>(f, Pair("b".to_string(), 5)), Pair("ab".to_string(), 10));Source§impl<First> Semimonad for PairWithFirstBrand<First>
impl<First> Semimonad for PairWithFirstBrand<First>
Source§fn bind<'a, F, A: 'a, B: 'a>(
ma: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
f: F,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
fn bind<'a, F, A: 'a, B: 'a>( ma: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, f: F, ) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
Chains pair computations (over second).
This method chains two computations, where the second computation depends on the result of the first. The first values are combined using their Semigroup implementation.
§Type Signature
forall a b t. (Semimonad (Pair t), Semigroup t) => (Pair t a, a -> Pair t b) -> Pair t b
§Type Parameters
F: The type of the function to apply.A: The type of the result of the first computation.B: The type of the result of the second computation.
§Parameters
ma: The first pair.f: The function to apply to the second value.
§Returns
A new pair where the first values are combined.
§Examples
use fp_library::classes::semimonad::bind;
use fp_library::brands::PairWithFirstBrand;
use fp_library::types::Pair;
use fp_library::types::string;
assert_eq!(
bind::<PairWithFirstBrand<String>, _, _, _>(Pair("a".to_string(), 5), |x| Pair("b".to_string(), x * 2)),
Pair("ab".to_string(), 10)
);Source§impl<First: Clone + 'static> Traversable for PairWithFirstBrand<First>
impl<First: Clone + 'static> Traversable for PairWithFirstBrand<First>
Source§fn traverse<'a, F: Applicative, Func, A: 'a + Clone, B: 'a + Clone>(
func: Func,
ta: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>>where
Func: Fn(A) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, B> + 'a,
<Self as Kind_cdc7cd43dac7585f>::Of<'a, B>: Clone,
fn traverse<'a, F: Applicative, Func, A: 'a + Clone, B: 'a + Clone>(
func: Func,
ta: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>>where
Func: Fn(A) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, B> + 'a,
<Self as Kind_cdc7cd43dac7585f>::Of<'a, B>: Clone,
Traverses the pair with an applicative function (over second).
This method maps the element of the pair to a computation, evaluates it, and combines the result into an applicative context (over second).
§Type Signature
forall a b f t. (Traversable (Pair t), Applicative f) => (a -> f b, Pair t a) -> f (Pair t b)
§Type Parameters
F: The applicative context.Func: The type of the function to apply.A: The type of the elements in the traversable structure.B: The type of the elements in the resulting traversable structure.
§Parameters
func: The function to apply to each element, returning a value in an applicative context.ta: The pair to traverse.
§Returns
The pair wrapped in the applicative context.
§Examples
use fp_library::classes::traversable::traverse;
use fp_library::brands::{PairWithFirstBrand, OptionBrand};
use fp_library::types::Pair;
assert_eq!(
traverse::<PairWithFirstBrand<()>, OptionBrand, _, _, _>(|x| Some(x * 2), Pair((), 5)),
Some(Pair((), 10))
);Source§fn sequence<'a, F: Applicative, A: 'a + Clone>(
ta: <Self as Kind_cdc7cd43dac7585f>::Of<'a, <F as Kind_cdc7cd43dac7585f>::Of<'a, A>>,
) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>>where
<F as Kind_cdc7cd43dac7585f>::Of<'a, A>: Clone,
<Self as Kind_cdc7cd43dac7585f>::Of<'a, A>: Clone,
fn sequence<'a, F: Applicative, A: 'a + Clone>(
ta: <Self as Kind_cdc7cd43dac7585f>::Of<'a, <F as Kind_cdc7cd43dac7585f>::Of<'a, A>>,
) -> <F as Kind_cdc7cd43dac7585f>::Of<'a, <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>>where
<F as Kind_cdc7cd43dac7585f>::Of<'a, A>: Clone,
<Self as Kind_cdc7cd43dac7585f>::Of<'a, A>: Clone,
Sequences a pair of applicative (over second).
This method evaluates the computation inside the pair and accumulates the result into an applicative context (over second).
§Type Signature
forall a f t. (Traversable (Pair t), Applicative f) => (Pair t (f a)) -> f (Pair t a)
§Type Parameters
F: The applicative context.A: The type of the elements in the traversable structure.
§Parameters
ta: The pair containing the applicative value.
§Returns
The pair wrapped in the applicative context.
§Examples
use fp_library::classes::traversable::sequence;
use fp_library::brands::{PairWithFirstBrand, OptionBrand};
use fp_library::types::Pair;
assert_eq!(
sequence::<PairWithFirstBrand<()>, OptionBrand, _>(Pair((), Some(5))),
Some(Pair((), 5))
);impl<First: Copy> Copy for PairWithFirstBrand<First>
impl<First: Eq> Eq for PairWithFirstBrand<First>
impl<First> StructuralPartialEq for PairWithFirstBrand<First>
Auto Trait Implementations§
impl<First> Freeze for PairWithFirstBrand<First>where
First: Freeze,
impl<First> RefUnwindSafe for PairWithFirstBrand<First>where
First: RefUnwindSafe,
impl<First> Send for PairWithFirstBrand<First>where
First: Send,
impl<First> Sync for PairWithFirstBrand<First>where
First: Sync,
impl<First> Unpin for PairWithFirstBrand<First>where
First: Unpin,
impl<First> UnwindSafe for PairWithFirstBrand<First>where
First: UnwindSafe,
Blanket Implementations§
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> 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