[][src]Enum subset_map::FindResult

pub enum FindResult<'a, E, P: 'a> {
    Perfect(&'a P),
    Excluded(&'a P, Vec<E>),
    NotFound,
}

The result of SubsetMap::find.

It can either be a perfect match on the subset or a match where some elements of the input set had to be excluded.

For FindResult::NotFound no tracking of excluded elements is done.

Variants

Perfect(&'a P)

The input set exactly matched a combination of the original set and there was a payload.

Excluded(&'a P, Vec<E>)

There were some elements in the input set that had to be excluded to match a subset of the original set.

Still there was a payload at the given position.

The excluded elements are returned.

NotFound

There was no match at all or the payload for the matched subset was None

Methods

impl<'a, E, P> FindResult<'a, E, P>[src]

pub fn payload(&self) -> Option<&P>[src]

pub fn excluded_elements(&self) -> &[E][src]

Returns the excluded elements if there was a match at all.

If there was no match the returned slice is also empty.

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

Returns true if there was a perfect match

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

Returns true if there was a match but some elements had to be excluded

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

Returns true if there was no match or if the payload for the matched subset was None

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

Returns true if there was a match even though some elements had to be excluded and if there was a payload for the matched subset.

Trait Implementations

impl<'a, E: Debug, P: Debug + 'a> Debug for FindResult<'a, E, P>[src]

Auto Trait Implementations

impl<'a, E, P> RefUnwindSafe for FindResult<'a, E, P> where
    E: RefUnwindSafe,
    P: RefUnwindSafe

impl<'a, E, P> Send for FindResult<'a, E, P> where
    E: Send,
    P: Sync

impl<'a, E, P> Sync for FindResult<'a, E, P> where
    E: Sync,
    P: Sync

impl<'a, E, P> Unpin for FindResult<'a, E, P> where
    E: Unpin

impl<'a, E, P> UnwindSafe for FindResult<'a, E, P> where
    E: UnwindSafe,
    P: RefUnwindSafe

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<T> for T[src]

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

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.