Enum Either

Source
pub enum Either<T, U> {
    Left(T),
    Right(U),
}
Expand description

Used to lift iterator generators into a sum type.

This is used in partial application, e.g. And::papp(true) returns Either::Left(Idb).

Variants§

§

Left(T)

The left iterator generator.

§

Right(U)

The right iterator generator.

Implementations§

Source§

impl<T> Either<T, Empty>

Source

pub fn inner(self) -> T

Gets the inner value.

Source§

impl<T> Either<Empty, T>

Source

pub fn inner_right(self) -> T

Gets the inner right value.

Trait Implementations§

Source§

impl<T: Clone, U: Clone> Clone for Either<T, U>

Source§

fn clone(&self) -> Either<T, U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T1, T2, U1, U2, V1, V2, I1, I2> HigherIntoIterator<Either<(U1, U2), Empty>> for (T1, T2)
where T1: HigherIntoIterator<Item<U1>, Item = V1, IntoIter = I1>, T2: Clone + HigherIntoIterator<Item<U2>, Item = V2, IntoIter = I2>, I1: Iterator<Item = V1>, U2: Clone,

Source§

type Item = (V1, V2)

The item type generated by the iterator.
Source§

type IntoIter = ProductIter<I1, I2, V1, V2>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<(U1, U2)>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl<T> HigherIntoIterator<Either<Range<T>, Empty>> for Id

Source§

type Item = T

The item type generated by the iterator.
Source§

type IntoIter = Range<T>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<Range<T>>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl<T> HigherIntoIterator<Either<Range<T>, Empty>> for Neg
where T: Sub<Output = T> + From<u8>,

Source§

type Item = T

The item type generated by the iterator.
Source§

type IntoIter = Range<T>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<Range<T>>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<Range<i64>, Empty>> for Add

Source§

type Item = (i64, i64)

The item type generated by the iterator.
Source§

type IntoIter = AddRangeIter

The iterator type.
Source§

fn hinto_iter(self, arg: Item<Range<i64>>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<Range<i64>, Empty>> for Square

Source§

type Item = i64

The item type generated by the iterator.
Source§

type IntoIter = SquareRangeIter

The iterator type.
Source§

fn hinto_iter(self, arg: Item<Range<i64>>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl<T, U, V, I> HigherIntoIterator<Either<U, Empty>> for Item<T>
where Item<T>: IntoIterator<Item = V, IntoIter = I>, I: Iterator<Item = V>,

Source§

type Item = V

The item type generated by the iterator.
Source§

type IntoIter = I

The iterator type.
Source§

fn hinto_iter(self, _: Item<U>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl<T, U, V, W, I1, I2> HigherIntoIterator<Either<V, Empty>> for Either<T, U>
where T: HigherIntoIterator<Item<V>, Item = W, IntoIter = I1>, U: HigherIntoIterator<Item<V>, Item = W, IntoIter = I2>, I1: Iterator<Item = W>, I2: Iterator<Item = W>,

Source§

type Item = W

The item type generated by the iterator.
Source§

type IntoIter = EitherIter<I1, I2>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<V>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for And

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Eqb

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for False1

Source§

type Item = bool

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<bool>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Fstb

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Idb

Source§

type Item = bool

The item type generated by the iterator.
Source§

type IntoIter = <Option<bool> as IntoIterator>::IntoIter

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Imply

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Not

Source§

type Item = bool

The item type generated by the iterator.
Source§

type IntoIter = <Option<bool> as IntoIterator>::IntoIter

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Or

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Sndb

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for True1

Source§

type Item = bool

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<bool>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<bool, Empty>> for Xor

Source§

type Item = (bool, bool)

The item type generated by the iterator.
Source§

type IntoIter = IntoIter<(bool, bool)>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<bool>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<i64, Empty>> for Add

Source§

type Item = (i64, i64)

The item type generated by the iterator.
Source§

type IntoIter = AddRangeIter

The iterator type.
Source§

fn hinto_iter(self, arg: Item<i64>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<i64, Empty>> for Id

Source§

type Item = i64

The item type generated by the iterator.
Source§

type IntoIter = Range<i64>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<i64>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<i64, Empty>> for Neg

Source§

type Item = i64

The item type generated by the iterator.
Source§

type IntoIter = Range<i64>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<i64>) -> Self::IntoIter

Construct iterator from an argument.
Source§

impl HigherIntoIterator<Either<i64, Empty>> for Square

Source§

type Item = i64

The item type generated by the iterator.
Source§

type IntoIter = Range<i64>

The iterator type.
Source§

fn hinto_iter(self, arg: Item<i64>) -> Self::IntoIter

Construct iterator from an argument.

Auto Trait Implementations§

§

impl<T, U> Freeze for Either<T, U>
where T: Freeze, U: Freeze,

§

impl<T, U> RefUnwindSafe for Either<T, U>

§

impl<T, U> Send for Either<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for Either<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for Either<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for Either<T, U>
where T: UnwindSafe, U: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.