pub struct EitherPartition<L, R> {
pub lefts: Vec<L>,
pub rights: Vec<R>,
}Expand description
A partition result holding separated Left and Right values from a collection.
Fields§
§lefts: Vec<L>All Left values collected from the input.
rights: Vec<R>All Right values collected from the input.
Implementations§
Source§impl<L, R> EitherPartition<L, R>
impl<L, R> EitherPartition<L, R>
Sourcepub fn from_iter<I: IntoIterator<Item = OxiEither<L, R>>>(iter: I) -> Self
pub fn from_iter<I: IntoIterator<Item = OxiEither<L, R>>>(iter: I) -> Self
Partition an iterator of OxiEither values into lefts and rights.
Sourcepub fn left_ratio(&self) -> f64
pub fn left_ratio(&self) -> f64
Returns the ratio of lefts to total (0.0 if empty).
Auto Trait Implementations§
impl<L, R> Freeze for EitherPartition<L, R>
impl<L, R> RefUnwindSafe for EitherPartition<L, R>where
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<L, R> Send for EitherPartition<L, R>
impl<L, R> Sync for EitherPartition<L, R>
impl<L, R> Unpin for EitherPartition<L, R>
impl<L, R> UnsafeUnpin for EitherPartition<L, R>
impl<L, R> UnwindSafe for EitherPartition<L, R>where
L: UnwindSafe,
R: 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
Mutably borrows from an owned value. Read more