[][src]Struct pets::PetRef

pub struct PetRef<'a, T: ?Sized, P>(_, _);

A reference to a value that is accepted by a given predicate.

Methods

impl<'a, T: ?Sized, P: Pred<T>> PetRef<'a, T, P>[src]

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

Attempts to create a new PetRef<'a, T, P> from a reference t.

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

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

Creates a new PetRef<'a, T, P> from a reference t without checking if P accepts t.

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

Retrieves the reference contained in this PetRef<'a, T, P>.

Trait Implementations

impl<'a, T: ?Sized, P> Eq for PetRef<'a, T, P> where
    T: Eq
[src]

impl<'a, T: Clone + ?Sized, P: Clone> Clone for PetRef<'a, T, P>[src]

impl<'a, T: ?Sized, P> AsRef<T> for PetRef<'a, T, P>[src]

impl<'a, 'b, T: ?Sized, P, Q> PartialOrd<PetRef<'b, T, Q>> for PetRef<'a, T, P> where
    T: PartialOrd
[src]

impl<'a, 'b, T: ?Sized, P, Q> PartialEq<PetRef<'b, T, Q>> for PetRef<'a, T, P> where
    T: PartialEq
[src]

impl<'a, T: ?Sized, P> Ord for PetRef<'a, T, P> where
    T: Ord
[src]

impl<'a, T: Copy + ?Sized, P: Copy> Copy for PetRef<'a, T, P>[src]

impl<'a, T, P> Hash for PetRef<'a, T, P> where
    T: Hash
[src]

impl<'a, T: ?Sized, P> Debug for PetRef<'a, T, P> where
    T: Debug,
    P: Debug
[src]

impl<'a, T, P> Display for PetRef<'a, T, P> where
    T: Display
[src]

impl<'a, T: ?Sized, P> Borrow<T> for PetRef<'a, T, P>[src]

Auto Trait Implementations

impl<'a, T: ?Sized, P> Send for PetRef<'a, T, P> where
    P: Send,
    T: Sync

impl<'a, T: ?Sized, P> Unpin for PetRef<'a, T, P> where
    P: Unpin

impl<'a, T: ?Sized, P> Sync for PetRef<'a, T, P> where
    P: Sync,
    T: Sync

impl<'a, T: ?Sized, P> UnwindSafe for PetRef<'a, T, P> where
    P: UnwindSafe,
    T: RefUnwindSafe

impl<'a, T: ?Sized, P> RefUnwindSafe for PetRef<'a, 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]