[−][src]Struct pets::PetRef
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]
T: Eq,
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]
T: PartialOrd,
fn partial_cmp(&self, o: &PetRef<'b, T, Q>) -> Option<Ordering>
[src]
fn lt(&self, o: &PetRef<'b, T, Q>) -> bool
[src]
fn le(&self, o: &PetRef<'b, T, Q>) -> bool
[src]
fn gt(&self, o: &PetRef<'b, T, Q>) -> bool
[src]
fn ge(&self, o: &PetRef<'b, T, Q>) -> bool
[src]
impl<'a, 'b, T: ?Sized, P, Q> PartialEq<PetRef<'b, T, Q>> for PetRef<'a, T, P> where
T: PartialEq,
[src]
T: PartialEq,
impl<'a, T: ?Sized, P> Ord for PetRef<'a, T, P> where
T: Ord,
[src]
T: Ord,
fn cmp(&self, o: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[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]
T: Hash,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, T: ?Sized, P> Debug for PetRef<'a, T, P> where
T: Debug,
P: Debug,
[src]
T: Debug,
P: Debug,
impl<'a, T, P> Display for PetRef<'a, T, P> where
T: Display,
[src]
T: Display,
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,
P: Send,
T: Sync,
impl<'a, T: ?Sized, P> Unpin for PetRef<'a, T, P> where
P: Unpin,
P: Unpin,
impl<'a, T: ?Sized, P> Sync for PetRef<'a, T, P> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
impl<'a, T: ?Sized, P> UnwindSafe for PetRef<'a, T, P> where
P: UnwindSafe,
T: RefUnwindSafe,
P: UnwindSafe,
T: RefUnwindSafe,
impl<'a, T: ?Sized, P> RefUnwindSafe for PetRef<'a, T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
P: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,