pub struct StepWithDoneBrand<B>(/* private fields */);Trait Implementations§
Source§impl<DoneType: Clone + 'static> ApplyFirst for StepWithDoneBrand<DoneType>
impl<DoneType: Clone + 'static> ApplyFirst for StepWithDoneBrand<DoneType>
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<DoneType: Clone + 'static> ApplySecond for StepWithDoneBrand<DoneType>
impl<DoneType: Clone + 'static> ApplySecond for StepWithDoneBrand<DoneType>
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<B: Clone> Clone for StepWithDoneBrand<B>
impl<B: Clone> Clone for StepWithDoneBrand<B>
Source§fn clone(&self) -> StepWithDoneBrand<B>
fn clone(&self) -> StepWithDoneBrand<B>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<B: Debug> Debug for StepWithDoneBrand<B>
impl<B: Debug> Debug for StepWithDoneBrand<B>
Source§impl<B: Default> Default for StepWithDoneBrand<B>
impl<B: Default> Default for StepWithDoneBrand<B>
Source§fn default() -> StepWithDoneBrand<B>
fn default() -> StepWithDoneBrand<B>
Source§impl<DoneType: 'static> Foldable for StepWithDoneBrand<DoneType>
impl<DoneType: 'static> Foldable for StepWithDoneBrand<DoneType>
Source§fn fold_right<'a, FnBrand, A: 'a, B: 'a, F>(
func: F,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
F: Fn(A, B) -> B + 'a,
FnBrand: CloneableFn + 'a,
fn fold_right<'a, FnBrand, A: 'a, B: 'a, F>(
func: F,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
F: Fn(A, B) -> B + 'a,
FnBrand: CloneableFn + 'a,
Folds the step from the right (over loop).
This method performs a right-associative fold of the step (over loop).
§Type Signature
forall self a b. Foldable self => ((a, b) -> b, b, self a) -> b
§Type Parameters
'a: The lifetime of the values.FnBrand: The brand of the cloneable function to use.A: The type of the elements in the structure.B: The type of the accumulator.F: The type of the folding function.
§Parameters
func: The folding function.initial: The initial value.fa: The step to fold.
§Returns
func(a, initial) if fa is Loop(a), otherwise initial.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(fold_right::<RcFnBrand, StepWithDoneBrand<i32>, _, _, _>(|x: i32, acc| x + acc, 0, Step::Loop(1)), 1);
assert_eq!(fold_right::<RcFnBrand, StepWithDoneBrand<()>, _, _, _>(|x: i32, acc| x + acc, 0, Step::Done(())), 0);Source§fn fold_left<'a, FnBrand, A: 'a, B: 'a, F>(
func: F,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
F: Fn(B, A) -> B + 'a,
FnBrand: CloneableFn + 'a,
fn fold_left<'a, FnBrand, A: 'a, B: 'a, F>(
func: F,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> Bwhere
F: Fn(B, A) -> B + 'a,
FnBrand: CloneableFn + 'a,
Folds the step from the left (over loop).
This method performs a left-associative fold of the step (over loop).
§Type Signature
forall self a b. Foldable self => ((b, a) -> b, b, self a) -> b
§Type Parameters
'a: The lifetime of the values.FnBrand: The brand of the cloneable function to use.A: The type of the elements in the structure.B: The type of the accumulator.F: The type of the folding function.
§Parameters
func: The folding function.initial: The initial value.fa: The step to fold.
§Returns
func(initial, a) if fa is Loop(a), otherwise initial.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(fold_left::<RcFnBrand, StepWithDoneBrand<()>, _, _, _>(|acc, x: i32| acc + x, 0, Step::Loop(5)), 5);
assert_eq!(fold_left::<RcFnBrand, StepWithDoneBrand<i32>, _, _, _>(|acc, x: i32| acc + x, 0, Step::Done(1)), 0);Source§fn fold_map<'a, FnBrand, A: 'a, M, F>(
func: F,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> M
fn fold_map<'a, FnBrand, A: 'a, M, F>( func: F, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> M
Maps the value to a monoid and returns it (over loop).
This method maps the element of the step to a monoid and then returns it (over loop).
§Type Signature
forall self a m. (Foldable self, Monoid m) => (a -> m, self a) -> m
§Type Parameters
'a: The lifetime of the values.FnBrand: The brand of the cloneable function to use.A: The type of the elements in the structure.M: The type of the monoid.F: The type of the mapping function.
§Parameters
func: The mapping function.fa: The step to fold.
§Returns
func(a) if fa is Loop(a), otherwise M::empty().
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(
fold_map::<RcFnBrand, StepWithDoneBrand<()>, _, _, _>(|x: i32| x.to_string(), Step::Loop(5)),
"5".to_string()
);
assert_eq!(
fold_map::<RcFnBrand, StepWithDoneBrand<i32>, _, _, _>(|x: i32| x.to_string(), Step::Done(1)),
"".to_string()
);Source§impl<DoneType: 'static> Functor for StepWithDoneBrand<DoneType>
impl<DoneType: 'static> Functor for StepWithDoneBrand<DoneType>
Source§fn map<'a, A: 'a, B: 'a, Func>(
func: Func,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>where
Func: Fn(A) -> B + 'a,
fn map<'a, A: 'a, B: 'a, Func>(
func: Func,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>where
Func: Fn(A) -> B + 'a,
Maps a function over the loop value in the step.
This method applies a function to the loop value inside the step, producing a new step with the transformed loop value. The done value remains unchanged.
§Type Signature
forall self a b. Functor self => (a -> b, self a) -> self b
§Type Parameters
'a: The lifetime of the values.A: The type of the loop value.B: The type of the result of applying the function.Func: The type of the function to apply.
§Parameters
func: The function to apply to the loop value.fa: The step to map over.
§Returns
A new step containing the result of applying the function to the loop value.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(map::<StepWithDoneBrand<i32>, _, _, _>(|x: i32| x * 2, Step::<i32, i32>::Loop(5)), Step::Loop(10));Source§impl<B: Hash> Hash for StepWithDoneBrand<B>
impl<B: Hash> Hash for StepWithDoneBrand<B>
Source§impl<DoneType: 'static> Kind_cdc7cd43dac7585f for StepWithDoneBrand<DoneType>
Generated implementation of Kind_cdc7cd43dac7585f for StepWithDoneBrand < DoneType >.
impl<DoneType: 'static> Kind_cdc7cd43dac7585f for StepWithDoneBrand<DoneType>
Generated implementation of Kind_cdc7cd43dac7585f for StepWithDoneBrand < DoneType >.
Source§impl<DoneType: Clone + 'static> Lift for StepWithDoneBrand<DoneType>
impl<DoneType: Clone + 'static> Lift for StepWithDoneBrand<DoneType>
Source§fn lift2<'a, A, B, C, Func>(
func: Func,
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, A, B, C, Func>( func: Func, 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 step context (over loop).
This method lifts a binary function to operate on loop values within the step context.
§Type Signature
forall self a b c. Lift self => ((a, b) -> c, self a, self b) -> self c
§Type Parameters
'a: The lifetime of the values.A: The type of the first loop value.B: The type of the second loop value.C: The type of the result loop value.Func: The type of the binary function.
§Parameters
func: The binary function to apply to the loops.fa: The first step.fb: The second step.
§Returns
Loop(f(a, b)) if both steps are Loop, otherwise the first done encountered.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(
lift2::<StepWithDoneBrand<i32>, _, _, _, _>(|x: i32, y: i32| x + y, Step::Loop(1), Step::Loop(2)),
Step::Loop(3)
);
assert_eq!(
lift2::<StepWithDoneBrand<i32>, _, _, _, _>(|x: i32, y: i32| x + y, Step::Loop(1), Step::Done(2)),
Step::Done(2)
);Source§impl<B: Ord> Ord for StepWithDoneBrand<B>
impl<B: Ord> Ord for StepWithDoneBrand<B>
Source§fn cmp(&self, other: &StepWithDoneBrand<B>) -> Ordering
fn cmp(&self, other: &StepWithDoneBrand<B>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<DoneType: 'static> ParFoldable for StepWithDoneBrand<DoneType>
impl<DoneType: 'static> ParFoldable for StepWithDoneBrand<DoneType>
Source§fn par_fold_map<'a, FnBrand, A, M>(
func: <FnBrand as SendCloneableFn>::SendOf<'a, A, M>,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> M
fn par_fold_map<'a, FnBrand, A, M>( func: <FnBrand as SendCloneableFn>::SendOf<'a, A, M>, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> M
Maps the value to a monoid and returns it, or returns empty, in parallel (over loop).
This method maps the element of the step to a monoid and then returns it (over loop). The mapping operation may be executed in parallel.
§Type Signature
forall self a m. (ParFoldable self, Monoid m) => (a -> m, self a) -> m
§Type Parameters
'a: The lifetime of the values.FnBrand: The brand of the cloneable function wrapper.A: The element type.M: The monoid type.
§Parameters
func: The thread-safe function to map each element to a monoid.fa: The step to fold.
§Returns
The combined monoid value.
§Examples
use fp_library::{brands::*, classes::*, functions::*, types::*};
let x: Step<i32, i32> = Step::Loop(5);
let f = send_cloneable_fn_new::<ArcFnBrand, _, _>(|x: i32| x.to_string());
assert_eq!(par_fold_map::<ArcFnBrand, StepWithDoneBrand<i32>, _, _>(f.clone(), x), "5".to_string());
let x_done: Step<i32, i32> = Step::Done(1);
assert_eq!(par_fold_map::<ArcFnBrand, StepWithDoneBrand<i32>, _, _>(f, x_done), "".to_string());Source§fn par_fold_right<'a, FnBrand, A, B>(
func: <FnBrand as SendCloneableFn>::SendOf<'a, (A, B), B>,
initial: B,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> B
fn par_fold_right<'a, FnBrand, A, B>( func: <FnBrand as SendCloneableFn>::SendOf<'a, (A, B), B>, initial: B, fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, ) -> B
Folds the step from the right in parallel (over loop).
This method folds the step by applying a function from right to left, potentially in parallel (over loop).
§Type Signature
forall self a b. ParFoldable self => ((a, b) -> b, b, self a) -> b
§Type Parameters
'a: The lifetime of the values.FnBrand: The brand of the cloneable function wrapper.A: The element type.B: The accumulator type.
§Parameters
func: The thread-safe function to apply to each element and the accumulator.initial: The initial value.fa: The step to fold.
§Returns
The final accumulator value.
§Examples
use fp_library::{brands::*, classes::*, functions::*, types::*};
let x: Step<i32, i32> = Step::Loop(5);
let f = send_cloneable_fn_new::<ArcFnBrand, _, _>(|(a, b): (i32, i32)| a + b);
assert_eq!(par_fold_right::<ArcFnBrand, StepWithDoneBrand<i32>, _, _>(f.clone(), 10, x), 15);
let x_done: Step<i32, i32> = Step::Done(1);
assert_eq!(par_fold_right::<ArcFnBrand, StepWithDoneBrand<i32>, _, _>(f, 10, x_done), 10);Source§impl<B: PartialEq> PartialEq for StepWithDoneBrand<B>
impl<B: PartialEq> PartialEq for StepWithDoneBrand<B>
Source§impl<B: PartialOrd> PartialOrd for StepWithDoneBrand<B>
impl<B: PartialOrd> PartialOrd for StepWithDoneBrand<B>
Source§impl<DoneType: 'static> Pointed for StepWithDoneBrand<DoneType>
impl<DoneType: 'static> Pointed for StepWithDoneBrand<DoneType>
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 step (as loop).
This method wraps a value in the Loop variant of a Step.
§Type Signature
forall self a. Pointed self => a -> self a
§Type Parameters
'a: The lifetime of the value.A: The type of the value to wrap.
§Parameters
a: The value to wrap.
§Returns
Loop(a).
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(pure::<StepWithDoneBrand<()>, _>(5), Step::Loop(5));Source§impl<DoneType: Clone + 'static> Semiapplicative for StepWithDoneBrand<DoneType>
impl<DoneType: Clone + 'static> Semiapplicative for StepWithDoneBrand<DoneType>
Source§fn apply<'a, FnBrand: 'a + CloneableFn, A: 'a + Clone, B: 'a>(
ff: <Self as Kind_cdc7cd43dac7585f>::Of<'a, <FnBrand as CloneableFn>::Of<'a, A, B>>,
fa: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
fn apply<'a, FnBrand: 'a + CloneableFn, A: 'a + Clone, B: 'a>( ff: <Self as Kind_cdc7cd43dac7585f>::Of<'a, <FnBrand as CloneableFn>::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 loop).
This method applies a function wrapped in a step (as loop) to a value wrapped in a step (as loop).
§Type Signature
forall self a b. Semiapplicative self => (self (a -> b), self a) -> self b
§Type Parameters
'a: The lifetime of the values.FnBrand: The brand of the cloneable function wrapper.A: The type of the input value.B: The type of the output value.
§Parameters
ff: The step containing the function (in Loop).fa: The step containing the value (in Loop).
§Returns
Loop(f(a)) if both are Loop, otherwise the first done encountered.
§Examples
use fp_library::{brands::*, classes::*, functions::*, types::*};
let f: Step<_, ()> = Step::Loop(cloneable_fn_new::<RcFnBrand, _, _>(|x: i32| x * 2));
assert_eq!(apply::<RcFnBrand, StepWithDoneBrand<()>, _, _>(f, Step::Loop(5)), Step::Loop(10));Source§impl<DoneType: Clone + 'static> Semimonad for StepWithDoneBrand<DoneType>
impl<DoneType: Clone + 'static> Semimonad for StepWithDoneBrand<DoneType>
Source§fn bind<'a, A: 'a, B: 'a, Func>(
ma: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>,
func: Func,
) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
fn bind<'a, A: 'a, B: 'a, Func>( ma: <Self as Kind_cdc7cd43dac7585f>::Of<'a, A>, func: Func, ) -> <Self as Kind_cdc7cd43dac7585f>::Of<'a, B>
Chains step computations (over loop).
This method chains two computations, where the second computation depends on the result of the first (over loop).
§Type Signature
forall self a b. Semimonad self => (self a, a -> self b) -> self b
§Type Parameters
'a: The lifetime of the values.A: The type of the result of the first computation.B: The type of the result of the second computation.Func: The type of the function to apply.
§Parameters
ma: The first step.func: The function to apply to the loop value.
§Returns
The result of applying f to the loop if ma is Loop, otherwise the original done.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(
bind::<StepWithDoneBrand<()>, _, _, _>(Step::Loop(5), |x| Step::Loop(x * 2)),
Step::Loop(10)
);Source§impl<DoneType: Clone + 'static> Traversable for StepWithDoneBrand<DoneType>
impl<DoneType: Clone + 'static> Traversable for StepWithDoneBrand<DoneType>
Source§fn traverse<'a, A: 'a + Clone, B: 'a + Clone, F: Applicative, Func>(
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, A: 'a + Clone, B: 'a + Clone, F: Applicative, Func>(
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 step with an applicative function (over loop).
This method maps the element of the step to a computation, evaluates it, and combines the result into an applicative context (over loop).
§Type Signature
forall self a b f. (Traversable self, Applicative f) => (a -> f b, self a) -> f (self b)
§Type Parameters
'a: The lifetime of the values.A: The type of the elements in the traversable structure.B: The type of the elements in the resulting traversable structure.F: The applicative context.Func: The type of the function to apply.
§Parameters
func: The function to apply.ta: The step to traverse.
§Returns
The step wrapped in the applicative context.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(
traverse::<StepWithDoneBrand<()>, _, _, OptionBrand, _>(|x| Some(x * 2), Step::Loop(5)),
Some(Step::Loop(10))
);
assert_eq!(
traverse::<StepWithDoneBrand<i32>, _, _, OptionBrand, _>(|x: i32| Some(x * 2), Step::Done(1)),
Some(Step::Done(1))
);Source§fn sequence<'a, A: 'a + Clone, F: Applicative>(
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, A: 'a + Clone, F: Applicative>(
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 step of applicative (over loop).
This method evaluates the computation inside the step and accumulates the result into an applicative context (over loop).
§Type Signature
forall self a f. (Traversable self, Applicative f) => self (f a) -> f (self a)
§Type Parameters
'a: The lifetime of the values.A: The type of the elements in the traversable structure.F: The applicative context.
§Parameters
ta: The step containing the applicative value.
§Returns
The step wrapped in the applicative context.
§Examples
use fp_library::{brands::*, functions::*, types::*};
assert_eq!(
sequence::<StepWithDoneBrand<()>, _, OptionBrand>(Step::Loop(Some(5))),
Some(Step::Loop(5))
);
assert_eq!(
sequence::<StepWithDoneBrand<i32>, i32, OptionBrand>(Step::Done::<Option<i32>, _>(1)),
Some(Step::Done::<i32, i32>(1))
);impl<B: Copy> Copy for StepWithDoneBrand<B>
impl<B: Eq> Eq for StepWithDoneBrand<B>
impl<B> StructuralPartialEq for StepWithDoneBrand<B>
Auto Trait Implementations§
impl<B> Freeze for StepWithDoneBrand<B>
impl<B> RefUnwindSafe for StepWithDoneBrand<B>where
B: RefUnwindSafe,
impl<B> Send for StepWithDoneBrand<B>where
B: Send,
impl<B> Sync for StepWithDoneBrand<B>where
B: Sync,
impl<B> Unpin for StepWithDoneBrand<B>where
B: Unpin,
impl<B> UnwindSafe for StepWithDoneBrand<B>where
B: 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