Skip to main content

EitherPartitionSm

Struct EitherPartitionSm 

Source
pub struct EitherPartitionSm<L, R> {
    pub lefts: Vec<L>,
    pub rights: Vec<R>,
}
Expand description

Partition result for Either (Sum) type, holding separated lefts and rights.

Fields§

§lefts: Vec<L>

All left values.

§rights: Vec<R>

All right values.

Implementations§

Source§

impl<L, R> EitherPartitionSm<L, R>

Source

pub fn from_vec(xs: Vec<Coproduct<L, R>>) -> Self

Create from a vector of Coproducts.

Source

pub fn total(&self) -> usize

Total number of elements.

Source

pub fn all_right(&self) -> bool

True if there are no left values.

Source

pub fn all_left(&self) -> bool

True if there are no right values.

Source

pub fn left_count(&self) -> usize

Left count.

Source

pub fn right_count(&self) -> usize

Right count.

Auto Trait Implementations§

§

impl<L, R> Freeze for EitherPartitionSm<L, R>

§

impl<L, R> RefUnwindSafe for EitherPartitionSm<L, R>

§

impl<L, R> Send for EitherPartitionSm<L, R>
where L: Send, R: Send,

§

impl<L, R> Sync for EitherPartitionSm<L, R>
where L: Sync, R: Sync,

§

impl<L, R> Unpin for EitherPartitionSm<L, R>
where L: Unpin, R: Unpin,

§

impl<L, R> UnsafeUnpin for EitherPartitionSm<L, R>

§

impl<L, R> UnwindSafe for EitherPartitionSm<L, R>
where L: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.