[−][src]Struct pets::Pet
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]
T: Eq,
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]
T: PartialOrd,
fn partial_cmp(&self, o: &Pet<T, Q>) -> Option<Ordering>
[src]
fn lt(&self, o: &Pet<T, Q>) -> bool
[src]
fn le(&self, o: &Pet<T, Q>) -> bool
[src]
fn gt(&self, o: &Pet<T, Q>) -> bool
[src]
fn ge(&self, o: &Pet<T, Q>) -> bool
[src]
impl<T, P, Q> PartialEq<Pet<T, Q>> for Pet<T, P> where
T: PartialEq,
[src]
T: PartialEq,
impl<T, P> Ord for Pet<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<T: Copy, P: Copy> Copy for Pet<T, P>
[src]
impl<T, P> Hash for Pet<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<T, P> Debug for Pet<T, P> where
T: Debug,
P: Debug,
[src]
T: Debug,
P: Debug,
impl<T, P> Display for Pet<T, P> where
T: Display,
[src]
T: Display,
impl<T, P> Borrow<T> for Pet<T, P>
[src]
impl<T, P: Pred<T>> Serialize for Pet<T, P> where
T: Serialize,
[src]
T: Serialize,
impl<'de, T, P: Pred<T>> Deserialize<'de> for Pet<T, P> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl<T, P> Send for Pet<T, P> where
P: Send,
T: Send,
P: Send,
T: Send,
impl<T, P> Unpin for Pet<T, P> where
P: Unpin,
T: Unpin,
P: Unpin,
T: Unpin,
impl<T, P> Sync for Pet<T, P> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
impl<T, P> UnwindSafe for Pet<T, P> where
P: UnwindSafe,
T: UnwindSafe,
P: UnwindSafe,
T: UnwindSafe,
impl<T, P> RefUnwindSafe for Pet<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,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,