Trait core::cmp::PartialEqStable
[-] [+]
[src]
pub trait PartialEq<Rhs: ?Sized = Self> { fn eq(&self, other: &Rhs) -> bool; fn ne(&self, other: &Rhs) -> bool { ... } }
Trait for equality comparisons which are partial equivalence relations.
This trait allows for partial equality, for types that do not have a full equivalence relation.
For example, in floating point numbers NaN != NaN
, so floating point types implement
PartialEq
but not Eq
.
Formally, the equality must be (for all a
, b
and c
):
- symmetric:
a == b
impliesb == a
; and - transitive:
a == b
andb == c
impliesa == c
.
Note that these requirements mean that the trait itself must be implemented symmetrically and
transitively: if T: PartialEq<U>
and U: PartialEq<V>
then U: PartialEq<T>
and T:
PartialEq<V>
.
PartialEq only requires the eq
method to be implemented; ne
is defined in terms of it by
default. Any manual implementation of ne
must respect the rule that eq
is a strict
inverse of ne
; that is, !(a == b)
if and only if a != b
.
Required Methods
fn eq(&self, other: &Rhs) -> bool
This method tests for self
and other
values to be equal, and is used by ==
.
Provided Methods
Implementors
impl PartialEq for FpCategory
impl PartialEq for ParseIntError
impl PartialEq for ParseFloatError
impl<T: PartialEq + Zeroable> PartialEq for NonZero<T>
impl<_R> PartialEq for extern "C" fn() -> _R
impl<_R, A> PartialEq for extern "C" fn(A) -> _R
impl<_R, A, B> PartialEq for extern "C" fn(A, B) -> _R
impl<_R, A, B, C> PartialEq for extern "C" fn(A, B, C) -> _R
impl<_R, A, B, C, D> PartialEq for extern "C" fn(A, B, C, D) -> _R
impl<_R, A, B, C, D, E> PartialEq for extern "C" fn(A, B, C, D, E) -> _R
impl<T> PartialEq for *const T
impl<T> PartialEq for *mut T
impl PartialEq for NoCopy
impl PartialEq for Managed
impl<T: ?Sized> PartialEq for PhantomData<T>
impl PartialEq for RangeFull
impl<Idx: PartialEq> PartialEq for Range<Idx>
impl<Idx: PartialEq> PartialEq for RangeFrom<Idx>
impl<Idx: PartialEq> PartialEq for RangeTo<Idx>
impl PartialEq for ()
impl PartialEq for bool
impl PartialEq for char
impl PartialEq for usize
impl PartialEq for u8
impl PartialEq for u16
impl PartialEq for u32
impl PartialEq for u64
impl PartialEq for isize
impl PartialEq for i8
impl PartialEq for i16
impl PartialEq for i32
impl PartialEq for i64
impl PartialEq for f32
impl PartialEq for f64
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a A where A: PartialEq<B>
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B>
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a A where A: PartialEq<B>
impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a mut A where A: PartialEq<B>
impl PartialEq for Ordering
impl PartialEq for TypeId
impl<T: PartialEq + Copy> PartialEq for Cell<T>
impl PartialEq for BorrowState
impl<T: PartialEq> PartialEq for RefCell<T>
impl<T: PartialEq> PartialEq for MinMaxResult<T>
impl<T: PartialEq> PartialEq for Option<T>
impl<T: PartialEq, E: PartialEq> PartialEq for Result<T, E>
impl<A, B> PartialEq<[B]> for [A] where A: PartialEq<B>
impl PartialEq for str
impl PartialEq for ParseBoolError
impl PartialEq for Utf8Error
impl PartialEq for Radix
impl<A: PartialEq> PartialEq for (A,)
impl<A: PartialEq, B: PartialEq> PartialEq for (A, B)
impl<A: PartialEq, B: PartialEq, C: PartialEq> PartialEq for (A, B, C)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq> PartialEq for (A, B, C, D)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq> PartialEq for (A, B, C, D, E)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq> PartialEq for (A, B, C, D, E, F)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq> PartialEq for (A, B, C, D, E, F, G)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq> PartialEq for (A, B, C, D, E, F, G, H)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq> PartialEq for (A, B, C, D, E, F, G, H, I)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq> PartialEq for (A, B, C, D, E, F, G, H, I, J)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq> PartialEq for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: PartialEq, B: PartialEq, C: PartialEq, D: PartialEq, E: PartialEq, F: PartialEq, G: PartialEq, H: PartialEq, I: PartialEq, J: PartialEq, K: PartialEq, L: PartialEq> PartialEq for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<A, B> PartialEq<[B; 0]> for [A; 0] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 0] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 0]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 1]> for [A; 1] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 1] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 1]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 2]> for [A; 2] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 2] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 2]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 3]> for [A; 3] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 3] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 3]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 4]> for [A; 4] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 4] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 4]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 5]> for [A; 5] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 5] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 5]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 6]> for [A; 6] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 6] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 6]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 7]> for [A; 7] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 7] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 7]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 8]> for [A; 8] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 8] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 8]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 9]> for [A; 9] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 9] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 9]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 10]> for [A; 10] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 10] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 10]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 11]> for [A; 11] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 11] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 11]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 12]> for [A; 12] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 12] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 12]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 13]> for [A; 13] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 13] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 13]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 14]> for [A; 14] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 14] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 14]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 15]> for [A; 15] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 15] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 15]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 16]> for [A; 16] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 16] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 16]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 17]> for [A; 17] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 17] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 17]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 18]> for [A; 18] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 18] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 18]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 19]> for [A; 19] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 19] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 19]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 20]> for [A; 20] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 20] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 20]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 21]> for [A; 21] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 21] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 21]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 22]> for [A; 22] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 22] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 22]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 23]> for [A; 23] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 23] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 23]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 24]> for [A; 24] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 24] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 24]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 25]> for [A; 25] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 25] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 25]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 26]> for [A; 26] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 26] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 26]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 27]> for [A; 27] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 27] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 27]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 28]> for [A; 28] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 28] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 28]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 29]> for [A; 29] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 29] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 29]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 30]> for [A; 30] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 30] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 30]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 31]> for [A; 31] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 31] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 31]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>
impl<A, B> PartialEq<[B; 32]> for [A; 32] where A: PartialEq<B>
impl<'a, A, B, Rhs> PartialEq<Rhs> for [A; 32] where A: PartialEq<B>, Rhs: Deref<Target=[B]>
impl<'a, A, B, Lhs> PartialEq<[B; 32]> for Lhs where A: PartialEq<B>, Lhs: Deref<Target=[A]>