Trait std::cmp::Eq
pub trait Eq { fn eq(&self, other: &Self) -> bool; fn ne(&self, other: &Self) -> bool { ... } }
Trait for values that can be compared for equality and inequality.
This trait allows partial equality, where types can be unordered instead of strictly equal or
unequal. For example, with the built-in floating-point types a == b
and a != b
will both
evaluate to false if either a
or b
is NaN (cf. IEEE 754-2008 section 5.11).
Eq only requires the eq
method to be implemented; ne
is its negation by default.
Eventually, this will be implemented by default for types that implement TotalEq
.
Required Methods
fn eq(&self, other: &Self) -> bool
Provided Methods
fn ne(&self, other: &Self) -> bool
Implementors
TypeId
SelectArm<'a>
PluralKeyword
PluralArm<'a>
PluralSelector
Method<'a>
Count<'a>
Flag
Alignment
Position<'a>
FormatSpec<'a>
Argument<'a>
Piece<'a>
Radix
PathPrefix
Path
Path
FileType
IoErrorKind
IoError
Signum
ProcessExit
SocketAddr
IpAddr
CString
Stolen<T>
TrySendResult<T>
TryRecvResult<T>
RefCell<T>
Cell<T>
Result<T, E>
Option<T>
MinMaxResult<T>
FPCategory
Ordering
Managed
NoShare
NoCopy
NoSend
InvariantLifetime<'a>
ContravariantLifetime<'a>
CovariantLifetime<'a>
InvariantType<T>
ContravariantType<T>
CovariantType<T>
Rc<T>
Ascii
MaybeOwned<'a>
UTF16Item
Vec<T>
impl Eq for int
impl Eq for i8
impl Eq for i16
impl Eq for i32
impl Eq for i64
impl Eq for uint
impl Eq for u8
impl Eq for u16
impl Eq for u32
impl Eq for u64
impl Eq for f32
impl Eq for f64
impl Eq for ()
impl Eq for bool
impl Eq for char
impl<A: Eq> Eq for (A)
impl<A: Eq, B: Eq> Eq for (A, B)
impl<A: Eq, B: Eq, C: Eq> Eq for (A, B, C)
impl<A: Eq, B: Eq, C: Eq, D: Eq> Eq for (A, B, C, D)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq> Eq for (A, B, C, D, E)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq> Eq for (A, B, C, D, E, F)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq> Eq for (A, B, C, D, E, F, G)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq> Eq for (A, B, C, D, E, F, G, H)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq> Eq for (A, B, C, D, E, F, G, H, I)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq> Eq for (A, B, C, D, E, F, G, H, I, J)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq, K: Eq> Eq for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq, K: Eq, L: Eq> Eq for (A, B, C, D, E, F, G, H, I, J, K, L)
impl<'a, T: Eq> Eq for &'a [T]
impl<T: Eq> Eq for ~[T]
impl<'a> Eq for &'a str
impl Eq for ~str
impl<_R> Eq for "C" fn() -> _R
impl<_R, A> Eq for "C" fn(A) -> _R
impl<_R, A, B> Eq for "C" fn(A, B) -> _R
impl<_R, A, B, C> Eq for "C" fn(A, B, C) -> _R
impl<_R, A, B, C, D> Eq for "C" fn(A, B, C, D) -> _R
impl<_R, A, B, C, D, E> Eq for "C" fn(A, B, C, D, E) -> _R
impl<T> Eq for *T
impl<T> Eq for *mut T
impl<T: Eq> Eq for ~T
impl<T: Eq> Eq for @T
impl<'a, T: Eq> Eq for &'a T