[][src]Enum few::Few

pub enum Few<T> {
    Zero,
    One(T),
    Two(T, T),
}

A type which may contain zero, one, or two of a value.

Variants

Zero

No value present.

One(T)

One value present.

Two(T, T)

Two values present.

Implementations

impl<T> Few<T>[src]

pub fn is_zero(&self) -> bool[src]

Returns true if the Few is a Zero value.

pub fn is_one(&self) -> bool[src]

Returns true if the Few is a One value.

pub fn is_two(&self) -> bool[src]

Returns true if the Few is a Two value.

pub fn contains<U>(&self, x: &U) -> bool where
    U: PartialEq<T>, 
[src]

Returns true if the Few is a One or Two value containing the given value.

Trait Implementations

impl<T: Clone> Clone for Few<T>[src]

impl<T: Copy> Copy for Few<T>[src]

impl<T: Debug> Debug for Few<T>[src]

impl<T> Default for Few<T>[src]

impl<T> DoubleEndedIterator for Few<T>[src]

impl<T: Eq> Eq for Few<T>[src]

impl<T> ExactSizeIterator for Few<T>[src]

impl<T> From<(Option<T>, Option<T>)> for Few<T>[src]

impl<T> From<(T, T)> for Few<T>[src]

impl<T> From<Option<(T, T)>> for Few<T>[src]

impl<T> From<Option<T>> for Few<T>[src]

impl<T> From<T> for Few<T>[src]

impl<T> FusedIterator for Few<T>[src]

impl<T: Hash> Hash for Few<T>[src]

impl<T> Iterator for Few<T>[src]

type Item = T

The type of the elements being iterated over.

impl<T: Ord> Ord for Few<T>[src]

impl<T: PartialEq> PartialEq<Few<T>> for Few<T>[src]

impl<T: PartialOrd> PartialOrd<Few<T>> for Few<T>[src]

impl<T> StructuralEq for Few<T>[src]

impl<T> StructuralPartialEq for Few<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Few<T> where
    T: RefUnwindSafe

impl<T> Send for Few<T> where
    T: Send

impl<T> Sync for Few<T> where
    T: Sync

impl<T> Unpin for Few<T> where
    T: Unpin

impl<T> UnwindSafe for Few<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.