[][src]Struct pets::Pet

pub struct Pet<T, P>(_, _);

A value that is accepted by a given predicate.

Methods

impl<T, P: Pred<T>> Pet<T, P>[src]

pub fn new(t: T) -> Option<Self>[src]

Attempts to create a new Pet<T, P> from a value t.

If P accepts t, then the result is a Some(..) containing the value t. Otherwise, None is returned.

pub unsafe fn new_unchecked(t: T) -> Self[src]

Creates a new Pet<T, P> from a value t without checking if P accepts t.

pub fn value(self) -> T[src]

Retrieves the value contained in this Pet<T, P>.

Trait Implementations

impl<T, P> Eq for Pet<T, P> where
    T: Eq
[src]

impl<T: Clone, P: Clone> Clone for Pet<T, P>[src]

impl<T, P> AsRef<T> for Pet<T, P>[src]

impl<T, P, Q> PartialOrd<Pet<T, Q>> for Pet<T, P> where
    T: PartialOrd
[src]

impl<T, P, Q> PartialEq<Pet<T, Q>> for Pet<T, P> where
    T: PartialEq
[src]

impl<T, P> Ord for Pet<T, P> where
    T: Ord
[src]

impl<T: Copy, P: Copy> Copy for Pet<T, P>[src]

impl<T, P> Hash for Pet<T, P> where
    T: Hash
[src]

impl<T, P> Debug for Pet<T, P> where
    T: Debug,
    P: Debug
[src]

impl<T, P> Display for Pet<T, P> where
    T: Display
[src]

impl<T, P> Borrow<T> for Pet<T, P>[src]

impl<T, P: Pred<T>> Serialize for Pet<T, P> where
    T: Serialize
[src]

impl<'de, T, P: Pred<T>> Deserialize<'de> for Pet<T, P> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T, P> Send for Pet<T, P> where
    P: Send,
    T: Send

impl<T, P> Unpin for Pet<T, P> where
    P: Unpin,
    T: Unpin

impl<T, P> Sync for Pet<T, P> where
    P: Sync,
    T: Sync

impl<T, P> UnwindSafe for Pet<T, P> where
    P: UnwindSafe,
    T: UnwindSafe

impl<T, P> RefUnwindSafe for Pet<T, P> where
    P: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]