Struct invariant::Invariant
[−]
[src]
pub struct Invariant<T: ?Sized, F = Box<FnMut(<T as ToOwned>::Owned) -> bool>> where
T: ToOwned, { /* fields omitted */ }
Methods
impl<T, F> Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn into_inner(self) -> T
impl<T: ?Sized, F> Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn as_inner_ref(&self) -> &T
impl<T, F> Invariant<T, F> where
T: ToOwned,
F: FnMut(<T as ToOwned>::Owned) -> bool,
[src]
T: ToOwned,
F: FnMut(<T as ToOwned>::Owned) -> bool,
fn try_from_inner(inner: T, check: F) -> Option<Self>
impl<T, F> Invariant<T, F> where
T: ToOwned,
F: FnMut(<T as ToOwned>::Owned) -> bool,
<T as ToOwned>::Owned: BorrowMut<T>,
[src]
T: ToOwned,
F: FnMut(<T as ToOwned>::Owned) -> bool,
<T as ToOwned>::Owned: BorrowMut<T>,
fn with_inner_mut<G, R>(&mut self, op: G) -> Option<R> where
G: FnOnce(&mut T) -> R,
G: FnOnce(&mut T) -> R,
fn with_inner_mut_check<G, R>(&mut self, op: G) -> Option<R> where
G: FnOnce(&mut T, &mut F) -> R,
G: FnOnce(&mut T, &mut F) -> R,
impl<T: ?Sized, F> Invariant<T, F> where
T: ToOwned,
T::Owned: Clone,
F: ToOwned,
[src]
T: ToOwned,
T::Owned: Clone,
F: ToOwned,
fn to_owned_inner(&self) -> Invariant<T::Owned, F::Owned>
Trait Implementations
impl<T: Debug + ?Sized, F: Debug> Debug for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: Clone + ?Sized, F: Clone> Clone for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn clone(&self) -> Invariant<T, F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Copy + ?Sized, F: Copy> Copy for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: ?Sized, F> Deref for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value
impl<U: ?Sized, T: PartialEq<U> + ?Sized, G, F> PartialEq<Invariant<U, G>> for Invariant<T, F> where
U: ToOwned,
T: ToOwned,
[src]
U: ToOwned,
T: ToOwned,
fn eq(&self, other: &Invariant<U, G>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Invariant<U, G>) -> bool
This method tests for !=
.
impl<T: Eq + ?Sized, F> Eq for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<U: ?Sized, T: PartialOrd<U> + ?Sized, G, F> PartialOrd<Invariant<U, G>> for Invariant<T, F> where
U: ToOwned,
T: ToOwned,
[src]
U: ToOwned,
T: ToOwned,
fn partial_cmp(&self, other: &Invariant<U, G>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Invariant<U, G>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Invariant<U, G>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Invariant<U, G>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Invariant<U, G>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord + ?Sized, F> Ord for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn cmp(&self, other: &Self) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<U, T: AsRef<U>, F> AsRef<U> for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn as_ref(&self) -> &U
Performs the conversion.
impl<T: Error + ?Sized, F: Debug + Any> Error for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more
impl<T: Display + ?Sized, F> Display for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn fmt(&self, formatter: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: LowerExp + ?Sized, F> LowerExp for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: UpperExp + ?Sized, F> UpperExp for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: Binary + ?Sized, F> Binary for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: Octal + ?Sized, F> Octal for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: LowerHex + ?Sized, F> LowerHex for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: UpperHex + ?Sized, F> UpperHex for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: Pointer + ?Sized, F> Pointer for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
impl<T: BuildHasher + ?Sized, F> BuildHasher for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
type Hasher = T::Hasher
Type of the hasher that will be created.
fn build_hasher(&self) -> Self::Hasher
Creates a new hasher. Read more
impl<T: Hash + ?Sized, F> Hash for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: IntoIterator, F> IntoIterator for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
type Item = T::Item
The type of the elements being iterated over.
type IntoIter = T::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<T: ToSocketAddrs, F> ToSocketAddrs for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,
type Iter = T::Iter
Returned iterator over socket addresses which this type may correspond to. Read more
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved SocketAddr
s. Read more
impl<Idx, T: Index<Idx> + ?Sized, F> Index<Idx> for Invariant<T, F> where
T: ToOwned,
[src]
T: ToOwned,