# Trait ethcore_util::standard::cmp::Eq 1.0.0 [−] [src]

    pub trait Eq: PartialEq<Self> { }

Trait for equality comparisons which are equivalence relations.

This means, that in addition to `a == b` and `a != b` being strict inverses, the equality must be (for all `a`, `b` and `c`):

- reflexive: `a == a`;
- symmetric: `a == b` implies `b == a`; and
- transitive: `a == b` and `b == c` implies `a == c`.

This property cannot be checked by the compiler, and therefore `Eq` implies `PartialEq`, and has no extra methods.

## Derivable

This trait can be used with `#[derive]`. When `derive`d, because `Eq` has no extra methods, it is only informing the compiler that this is an equivalence relation rather than a partial equivalence relation. Note that the `derive` strategy requires all fields are `Eq`, which isn't always desired.

## How can I implement `Eq`?

If you cannot use the `derive` strategy, specify that your type implements `Eq`, which has no methods:

    enum BookFormat { Paperback, Hardback, Ebook }
    struct Book {
        isbn: i32,
        format: BookFormat,
    }
    impl PartialEq for Book {
        fn eq(&self, other: &Book) -> bool {
            self.isbn == other.isbn
        }
    }
    impl Eq for Book {}

## Implementors

- `impl Eq for U512`
- `impl Eq for U256`
- `impl Eq for U128`
- `impl<K, V> Eq for BTreeMap<K, V> where K: Eq, V: Eq`
- `impl<'a, B> Eq for Cow<'a, B> where B: Eq + ToOwned + ?Sized`
- `impl<T> Eq for LinkedList<T> where T: Eq`
- `impl Eq for ParseError`
- `impl<T> Eq for Vec<T> where T: Eq`
- `impl<A> Eq for VecDeque<A> where A: Eq`
- `impl<T> Eq for BTreeSet<T> where T: Eq`
- `impl<E> Eq for EnumSet<E> where E: Eq`
- `impl Eq for String`
- `impl<T> Eq for Bound<T> where T: Eq`
- `impl Eq for Secp256k1`
- `impl Eq for SharedSecret`
- `impl Eq for PublicKey`
- `impl Eq for Signature`
- `impl Eq for RecoverableSignature`
- `impl Eq for SharedSecret`
- `impl Eq for SecretKey`
- `impl Eq for PublicKey`
- `impl Eq for Signature`
- `impl Eq for RecoveryId`
- `impl Eq for Signature`
- `impl Eq for RecoverableSignature`
- `impl Eq for Message`
- `impl Eq for Error`
- `impl Eq for ContextFlag`
- `impl<A> Eq for SmallVec<A> where A: Array, A::Item: Eq`
- `impl Eq for Utf8Sequence`
- `impl Eq for Utf8Range`
- `impl Eq for H32`
- `impl Eq for H64`
- `impl Eq for H128`
- `impl Eq for H160`
- `impl Eq for H256`
- `impl Eq for H264`
- `impl Eq for H512`
- `impl Eq for H520`
- `impl Eq for H1024`
- `impl Eq for H2048`
- `impl Eq for Literals`
- `impl Eq for Lit`
- `impl Eq for Expr`
- `impl Eq for Repeater`
- `impl Eq for CharClass`
- `impl Eq for ClassRange`
- `impl Eq for ByteClass`
- `impl Eq for ByteRange`
- `impl<T> Eq for ElasticArray2<T> where T: Eq`
- `impl<T> Eq for ElasticArray4<T> where T: Eq`
- `impl<T> Eq for ElasticArray8<T> where T: Eq`
- `impl<T> Eq for ElasticArray16<T> where T: Eq`
- `impl<T> Eq for ElasticArray32<T> where T: Eq`
- `impl<T> Eq for ElasticArray36<T> where T: Eq`
- `impl<T> Eq for ElasticArray64<T> where T: Eq`
- `impl<T> Eq for ElasticArray128<T> where T: Eq`
- `impl<T> Eq for ElasticArray256<T> where T: Eq`
- `impl<T> Eq for ElasticArray512<T> where T: Eq`
- `impl<T> Eq for ElasticArray1024<T> where T: Eq`
- `impl<T> Eq for ElasticArray2048<T> where T: Eq`
- `impl Eq for Match`
- `impl<T> Eq for Discriminant<T>`
- `impl<T> Eq for *const T where T: ?Sized`
- `impl<T> Eq for *mut T where T: ?Sized`
- `impl Eq for Ordering`
- `impl Eq for !`
- `impl<'a, A> Eq for &'a A where A: Eq + ?Sized`
- `impl<'a, A> Eq for &'a mut A where A: Eq + ?Sized`
- `impl<T> Eq for Cell<T> where T: Copy + Eq`
- `impl<T> Eq for RefCell<T> where T: Eq + ?Sized`
- `impl<T> Eq for [T] where T: Eq`
- `impl Eq for str`
- `impl<T> Eq for Wrapping<T> where T: Eq`
- `impl Eq for ParseFloatError`
- `impl Eq for FpCategory`
- `impl Eq for ParseIntError`
- `impl<T> Eq for NonZero<T> where T: Zeroable + Eq`
- `impl<Ret> Eq for fn() -> Ret`
- `impl<Ret> Eq for extern fn() -> Ret`
- `impl<Ret> Eq for unsafe fn() -> Ret`
- `impl<Ret> Eq for unsafe extern fn() -> Ret`
- `impl<Ret, A> Eq for fn(A) -> Ret`
- `impl<Ret, A> Eq for extern fn(A) -> Ret`
- `impl<Ret, A> Eq for extern fn(A, ...) -> Ret`
- `impl<Ret, A> Eq for unsafe fn(A) -> Ret`
- `impl<Ret, A> Eq for unsafe extern fn(A) -> Ret`
- `impl<Ret, A> Eq for unsafe extern fn(A, ...) -> Ret`
- `impl<Ret, A, B> Eq for fn(A, B) -> Ret`
- `impl<Ret, A, B> Eq for extern fn(A, B) -> Ret`
- `impl<Ret, A, B> Eq for extern fn(A, B, ...) -> Ret`
- `impl<Ret, A, B> Eq for unsafe fn(A, B) -> Ret`
- `impl<Ret, A, B> Eq for unsafe extern fn(A, B) -> Ret`
- `impl<Ret, A, B> Eq for unsafe extern fn(A, B, ...) -> Ret`
- `impl<Ret, A, B, C> Eq for fn(A, B, C) -> Ret`
- `impl<Ret, A, B, C> Eq for extern fn(A, B, C) -> Ret`
- `impl<Ret, A, B, C> Eq for extern fn(A, B, C, ...) -> Ret`
- `impl<Ret, A, B, C> Eq for unsafe fn(A, B, C) -> Ret`
- `impl<Ret, A, B, C> Eq for unsafe extern fn(A, B, C) -> Ret`
- `impl<Ret, A, B, C> Eq for unsafe extern fn(A, B, C, ...) -> Ret`
- `impl<Ret, A, B, C, D> Eq for fn(A, B, C, D) -> Ret`
- `impl<Ret, A, B, C, D> Eq for extern fn(A, B, C, D) -> Ret`
- `impl<Ret, A, B, C, D> Eq for extern fn(A, B, C, D, ...) -> Ret`
- `impl<Ret, A, B, C, D> Eq for unsafe fn(A, B, C, D) -> Ret`
- `impl<Ret, A, B, C, D> Eq for unsafe extern fn(A, B, C, D) -> Ret`
- `impl<Ret, A, B, C, D> Eq for unsafe extern fn(A, B, C, D, ...) -> Ret`
- `impl<Ret, A, B, C, D, E> Eq for fn(A, B, C, D, E) -> Ret`
- `impl<Ret, A, B, C, D, E> Eq for extern fn(A, B, C, D, E) -> Ret`
- `impl<Ret, A, B, C, D, E> Eq for extern fn(A, B, C, D, E, ...) -> Ret`
- `impl<Ret, A, B, C, D, E> Eq for unsafe fn(A, B, C, D, E) -> Ret`
- `impl<Ret, A, B, C, D, E> Eq for unsafe extern fn(A, B, C, D, E) -> Ret`
- `impl<Ret, A, B, C, D, E> Eq for unsafe extern fn(A, B, C, D, E, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F> Eq for fn(A, B, C, D, E, F) -> Ret`
- `impl<Ret, A, B, C, D, E, F> Eq for extern fn(A, B, C, D, E, F) -> Ret`
- `impl<Ret, A, B, C, D, E, F> Eq for extern fn(A, B, C, D, E, F, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F> Eq for unsafe fn(A, B, C, D, E, F) -> Ret`
- `impl<Ret, A, B, C, D, E, F> Eq for unsafe extern fn(A, B, C, D, E, F) -> Ret`
- `impl<Ret, A, B, C, D, E, F> Eq for unsafe extern fn(A, B, C, D, E, F, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G> Eq for fn(A, B, C, D, E, F, G) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G> Eq for extern fn(A, B, C, D, E, F, G) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G> Eq for extern fn(A, B, C, D, E, F, G, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G> Eq for unsafe fn(A, B, C, D, E, F, G) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G> Eq for unsafe extern fn(A, B, C, D, E, F, G) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G> Eq for unsafe extern fn(A, B, C, D, E, F, G, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H> Eq for fn(A, B, C, D, E, F, G, H) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H> Eq for extern fn(A, B, C, D, E, F, G, H) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H> Eq for extern fn(A, B, C, D, E, F, G, H, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe fn(A, B, C, D, E, F, G, H) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe extern fn(A, B, C, D, E, F, G, H) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I> Eq for fn(A, B, C, D, E, F, G, H, I) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I> Eq for extern fn(A, B, C, D, E, F, G, H, I) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I> Eq for extern fn(A, B, C, D, E, F, G, H, I, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe fn(A, B, C, D, E, F, G, H, I) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for fn(A, B, C, D, E, F, G, H, I, J) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for extern fn(A, B, C, D, E, F, G, H, I, J) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for extern fn(A, B, C, D, E, F, G, H, I, J, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe fn(A, B, C, D, E, F, G, H, I, J) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, J) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, J, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for extern fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for extern fn(A, B, C, D, E, F, G, H, I, J, K, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, J, K, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for extern fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for extern fn(A, B, C, D, E, F, G, H, I, J, K, L, ...) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret`
- `impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe extern fn(A, B, C, D, E, F, G, H, I, J, K, L, ...) -> Ret`
- `impl<T> Eq for PhantomData<T> where T: ?Sized`
- `impl Eq for RangeFull`
- `impl<Idx> Eq for Range<Idx> where Idx: Eq`
- `impl<Idx> Eq for RangeFrom<Idx> where Idx: Eq`
- `impl<Idx> Eq for RangeTo<Idx> where Idx: Eq`
- `impl<Idx> Eq for RangeInclusive<Idx> where Idx: Eq`
- `impl<Idx> Eq for RangeToInclusive<Idx> where Idx: Eq`
- `impl Eq for ()`
- `impl Eq for bool`
- `impl Eq for char`
- `impl Eq for usize`
- `impl Eq for u8`
- `impl Eq for u16`
- `impl Eq for u32`
- `impl Eq for u64`
- `impl Eq for isize`
- `impl Eq for i8`
- `impl Eq for i16`
- `impl Eq for i32`
- `impl Eq for i64`
- `impl Eq for TypeId`
- `impl<T> Eq for [T; 0] where T: Eq`
- `impl<T> Eq for [T; 1] where T: Eq`
- `impl<T> Eq for [T; 2] where T: Eq`
- `impl<T> Eq for [T; 3] where T: Eq`
- `impl<T> Eq for [T; 4] where T: Eq`
- `impl<T> Eq for [T; 5] where T: Eq`
- `impl<T> Eq for [T; 6] where T: Eq`
- `impl<T> Eq for [T; 7] where T: Eq`
- `impl<T> Eq for [T; 8] where T: Eq`
- `impl<T> Eq for [T; 9] where T: Eq`
- `impl<T> Eq for [T; 10] where T: Eq`
- `impl<T> Eq for [T; 11] where T: Eq`
- `impl<T> Eq for [T; 12] where T: Eq`
- `impl<T> Eq for [T; 13] where T: Eq`
- `impl<T> Eq for [T; 14] where T: Eq`
- `impl<T> Eq for [T; 15] where T: Eq`
- `impl<T> Eq for [T; 16] where T: Eq`
- `impl<T> Eq for [T; 17] where T: Eq`
- `impl<T> Eq for [T; 18] where T: Eq`
- `impl<T> Eq for [T; 19] where T: Eq`
- `impl<T> Eq for [T; 20] where T: Eq`
- `impl<T> Eq for [T; 21] where T: Eq`
- `impl<T> Eq for [T; 22] where T: Eq`
- `impl<T> Eq for [T; 23] where T: Eq`
- `impl<T> Eq for [T; 24] where T: Eq`
- `impl<T> Eq for [T; 25] where T: Eq`
- `impl<T> Eq for [T; 26] where T: Eq`
- `impl<T> Eq for [T; 27] where T: Eq`
- `impl<T> Eq for [T; 28] where T: Eq`
- `impl<T> Eq for [T; 29] where T: Eq`
- `impl<T> Eq for [T; 30] where T: Eq`
- `impl<T> Eq for [T; 31] where T: Eq`
- `impl<T> Eq for [T; 32] where T: Eq`
- `impl Eq for BorrowState`
- `impl Eq for CharTryFromError`
- `impl Eq for InvalidSequence`
- `impl<T> Eq for Option<T> where T: Eq`
- `impl<T, E> Eq for Result<T, E> where E: Eq, T: Eq`
- `impl Eq for SearchStep`
- `impl Eq for ParseBoolError`
- `impl Eq for Utf8Error`
- `impl Eq for Error`
- `impl<A> Eq for (A,) where A: Eq`
- `impl<A, B> Eq for (A, B) where A: Eq, B: Eq`
- `impl<A, B, C> Eq for (A, B, C) where A: Eq, B: Eq, C: Eq`
- `impl<A, B, C, D> Eq for (A, B, C, D) where A: Eq, B: Eq, C: Eq, D: Eq`
- `impl<A, B, C, D, E> Eq for (A, B, C, D, E) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq`
- `impl<A, B, C, D, E, F> Eq for (A, B, C, D, E, F) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq`
- `impl<A, B, C, D, E, F, G> Eq for (A, B, C, D, E, F, G) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq`
- `impl<A, B, C, D, E, F, G, H> Eq for (A, B, C, D, E, F, G, H) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq`
- `impl<A, B, C, D, E, F, G, H, I> Eq for (A, B, C, D, E, F, G, H, I) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq`
- `impl<A, B, C, D, E, F, G, H, I, J> Eq for (A, B, C, D, E, F, G, H, I, J) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq`
- `impl<A, B, C, D, E, F, G, H, I, J, K> Eq for (A, B, C, D, E, F, G, H, I, J, K) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq, K: Eq`
- `impl<A, B, C, D, E, F, G, H, I, J, K, L> Eq for (A, B, C, D, E, F, G, H, I, J, K, L) where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq, F: Eq, G: Eq, H: Eq, I: Eq, J: Eq, K: Eq, L: Eq`
- `impl Eq for DecoderError`
- `impl Eq for ParkResult`
- `impl Eq for UnparkResult`
- `impl Eq for RequeueOp`
- `impl Eq for FilterOp`
- `impl Eq for UnparkToken`
- `impl Eq for ParkToken`
- `impl Eq for Duration`
- `impl Eq for OutOfRangeError`
- `impl Eq for Timespec`
- `impl Eq for SteadyTime`
- `impl Eq for Tm`
- `impl<T> Eq for Box<T> where T: Eq + ?Sized`
- `impl<T> Eq for Arc<T> where T: Eq + ?Sized`
- `impl<T> Eq for Rc<T> where T: Eq + ?Sized`
- `impl<O, T> Eq for OwningRef<O, T> where T: Eq + ?Sized`
- `impl<K, V, S> Eq for HashMap<K, V, S> where K: Eq + Hash, S: BuildHasher, V: Eq`
- `impl<T, S> Eq for HashSet<T, S> where S: BuildHasher, T: Eq + Hash`
- `impl Eq for CStr`
- `impl Eq for OsString`
- `impl Eq for OsStr`
- `impl Eq for Ipv4Addr`
- `impl Eq for Ipv6Addr`
- `impl Eq for SocketAddrV4`
- `impl Eq for SocketAddrV6`
- `impl<'a> Eq for Components<'a>`
- `impl Eq for PathBuf`
- `impl Eq for Path`
- `impl Eq for LocalKeyState`
- `impl Eq for ThreadId`
- `impl Eq for VarError`
- `impl Eq for CString`
- `impl Eq for NulError`
- `impl Eq for FromBytesWithNulError`
- `impl Eq for IntoStringError`
- `impl Eq for Permissions`
- `impl Eq for FileType`
- `impl Eq for ErrorKind`
- `impl Eq for SeekFrom`
- `impl Eq for IpAddr`
- `impl Eq for Ipv6MulticastScope`
- `impl Eq for SocketAddr`
- `impl Eq for AddrParseError`
- `impl Eq for Shutdown`
- `impl<'a> Eq for Prefix<'a>`
- `impl<'a> Eq for PrefixComponent<'a>`
- `impl<'a> Eq for Component<'a>`
- `impl Eq for StripPrefixError`
- `impl Eq for Output`
- `impl Eq for ExitStatus`
- `impl<T> Eq for SendError<T> where T: Eq`
- `impl Eq for RecvError`
- `impl Eq for TryRecvError`
- `impl Eq for RecvTimeoutError`
- `impl<T> Eq for TrySendError<T> where T: Eq`
- `impl Eq for WaitTimeoutResult`
- `impl Eq for Duration`
- `impl Eq for Instant`
- `impl Eq for SystemTime`
- `impl<A, B> Eq for EitherOrBoth<A, B> where A: Eq, B: Eq`
- `impl Eq for Regex`
- `impl<K, V, S> Eq for LinkedHashMap<K, V, S> where K: Eq + Hash, S: BuildHasher, V: Eq`
- `impl Eq for Fe`
- `impl Eq for MacResult`
- `impl Eq for DecodeUtf16Error`
- `impl Eq for WaitTimeoutResult`
- `impl<A> Eq for ArrayString<A> where A: Array<Item=u8>`
- `impl<A> Eq for ArrayVec<A> where A: Array, A::Item: Eq`
- `impl<T> Eq for CapacityError<T> where T: Eq`
- `impl Eq for LogLevel`
- `impl Eq for LogLevelFilter`
- `impl<T: Eq + Debug> Eq for Mismatch<T>`
- `impl<T: Eq + Debug> Eq for OutOfBounds<T>`
- `impl Eq for Filth`
- `impl<'a> Eq for Node<'a>`
- `impl Eq for OwnedNode`
- `impl Eq for Record`
- `impl Eq for TrieError`
- `impl<'a> Eq for NibbleSlice<'a>`
- `impl Eq for NibbleVec`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)