Trait nom::lib::std::cmp::Eq1.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):

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 derived, 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 {}

Implementations on Foreign Types

impl Eq for ThreadId
[src]

impl Eq for FromBytesWithNulError
[src]

impl Eq for WaitTimeoutResult
[src]

impl Eq for CStr
[src]

impl<'a> Eq for Component<'a>
[src]

impl Eq for RecvError
[src]

impl Eq for Ipv4Addr
[src]

impl Eq for IpAddr
[src]

impl Eq for Instant
[src]

impl Eq for AddrParseError
[src]

impl Eq for TryRecvError
[src]

impl Eq for SocketAddrV4
[src]

impl Eq for SeekFrom
[src]

impl<T> Eq for TrySendError<T> where
    T: Eq
[src]

impl Eq for Ipv6Addr
[src]

impl<'a> Eq for Prefix<'a>
[src]

impl Eq for Shutdown
[src]

impl Eq for SocketAddrV6
[src]

impl Eq for ErrorKind
[src]

impl Eq for Output
[src]

impl Eq for IntoStringError
[src]

impl Eq for SystemTime
[src]

impl Eq for ExitStatus
[src]

impl Eq for CString
[src]

impl Eq for OsStr
[src]

impl Eq for StripPrefixError
[src]

impl Eq for RecvTimeoutError
[src]

impl Eq for VarError
[src]

impl Eq for Permissions
[src]

impl<T> Eq for SendError<T> where
    T: Eq
[src]

impl<'a> Eq for Components<'a>
[src]

impl<'a> Eq for PrefixComponent<'a>
[src]

impl Eq for NulError
[src]

impl Eq for Ipv6MulticastScope
[src]

impl Eq for SocketAddr
[src]

impl Eq for Path
[src]

impl Eq for FileType
[src]

impl Eq for PathBuf
[src]

impl Eq for OsString
[src]

impl Eq for u32
[src]

impl Eq for u32x8
[src]

impl<T> Eq for [T; 4] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, ...) -> Ret
[src]

impl Eq for ParseIntError
[src]

impl Eq for i16x32
[src]

impl Eq for i16x8
[src]

impl Eq for m32x8
[src]

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 + ?Sized
[src]

impl Eq for DecodeUtf16Error
[src]

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
[src]

impl<T> Eq for NonNull<T> where
    T: ?Sized
[src]

impl<Ret, A, B> Eq for fn(A, B) -> Ret
[src]

impl<T> Eq for [T; 5] where
    T: Eq
[src]

impl Eq for i64x4
[src]

impl<T> Eq for [T; 19] where
    T: Eq
[src]

impl Eq for m1x32
[src]

impl<T> Eq for Cell<T> where
    T: Copy + Eq
[src]

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 + ?Sized
[src]

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 + ?Sized
[src]

impl<T> Eq for [T; 20] where
    T: Eq
[src]

impl<T> Eq for *mut T where
    T: ?Sized
[src]

impl<Ret, A, B, C, D, E, F, G> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, ...) -> Ret
[src]

impl<Ret, A, B, C> Eq for unsafe extern "C" fn(A, B, C) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L, ...) -> Ret
[src]

impl<T> Eq for [T; 11] where
    T: Eq
[src]

impl<T> Eq for [T; 31] where
    T: Eq
[src]

impl Eq for i32x2
[src]

impl<T> Eq for [T; 25] where
    T: Eq
[src]

impl<T> Eq for [T; 3] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E> Eq for unsafe extern "C" fn(A, B, C, D, E) -> Ret
[src]

impl<T> Eq for [T] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret
[src]

impl<T> Eq for [T; 8] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E, F, G> Eq for extern "C" fn(A, B, C, D, E, F, G, ...) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J) -> Ret
[src]

impl<T> Eq for [T; 22] where
    T: Eq
[src]

impl Eq for i8
[src]

impl<T> Eq for [T; 15] where
    T: Eq
[src]

impl<Ret, A, B> Eq for unsafe fn(A, B) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L, ...) -> Ret
[src]

impl Eq for LayoutErr
[src]

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 + ?Sized
[src]

impl Eq for i16x16
[src]

impl<Ret, A> Eq for fn(A) -> Ret
[src]

impl Eq for m16x2
[src]

impl Eq for bool
[src]

impl Eq for u8x4
[src]

impl<Ret, A, B, C, D, E, F, G> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G) -> Ret
[src]

impl<Ret, A, B> Eq for unsafe extern "C" fn(A, B, ...) -> Ret
[src]

impl Eq for m8x32
[src]

impl Eq for m16x8
[src]

impl<Ret, A, B, C> Eq for unsafe fn(A, B, C) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I> Eq for fn(A, B, C, D, E, F, G, H, I) -> Ret
[src]

impl Eq for str
[src]

impl<Ret, A, B> Eq for unsafe extern "C" fn(A, B) -> Ret
[src]

impl<A, B, C> Eq for (A, B, C) where
    A: Eq,
    B: Eq,
    C: Eq + ?Sized
[src]

impl<Ret, A, B, C, D, E> Eq for unsafe extern "C" fn(A, B, C, D, E, ...) -> Ret
[src]

impl Eq for i8x2
[src]

impl<Ret, A, B, C, D, E, F> Eq for extern "C" fn(A, B, C, D, E, F) -> Ret
[src]

impl Eq for u32x2
[src]

impl<Ret, A, B, C, D, E, F, G, H, I> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I) -> Ret
[src]

impl Eq for i8x32
[src]

impl Eq for u16x32
[src]

impl<Ret, A, B, C, D, E, F, G, H> Eq for extern "C" fn(A, B, C, D, E, F, G, H) -> Ret
[src]

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
[src]

impl Eq for ()
[src]

impl Eq for m64x4
[src]

impl<A, B, C, D> Eq for (A, B, C, D) where
    A: Eq,
    B: Eq,
    C: Eq,
    D: Eq + ?Sized
[src]

impl Eq for CannotReallocInPlace
[src]

impl<T> Eq for [T; 13] where
    T: Eq
[src]

impl Eq for char
[src]

impl<Ret> Eq for unsafe fn() -> Ret
[src]

impl Eq for m32x4
[src]

impl<Ret, A, B, C, D, E, F, G, H> Eq for fn(A, B, C, D, E, F, G, H) -> Ret
[src]

impl Eq for m8x16
[src]

impl Eq for u16
[src]

impl Eq for i32x4
[src]

impl Eq for NonZeroUsize
[src]

impl Eq for isize
[src]

impl<T> Eq for [T; 7] where
    T: Eq
[src]

impl<Ret, A, B, C, D> Eq for extern "C" fn(A, B, C, D, ...) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G> Eq for extern "C" fn(A, B, C, D, E, F, G) -> Ret
[src]

impl Eq for i64
[src]

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
[src]

impl Eq for NonZeroI64
[src]

impl<T> Eq for [T; 17] where
    T: Eq
[src]

impl Eq for usize
[src]

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
[src]

impl Eq for ParseFloatError
[src]

impl Eq for m32x2
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J) -> Ret
[src]

impl Eq for i8x16
[src]

impl Eq for u32x16
[src]

impl<Ret, A, B, C, D, E, F, G, H, I> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, ...) -> Ret
[src]

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
[src]

impl Eq for u16x8
[src]

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
[src]

impl<Ret, A, B, C, D, E, F> Eq for unsafe extern "C" fn(A, B, C, D, E, F, ...) -> Ret
[src]

impl<A, B> Eq for (A, B) where
    A: Eq,
    B: Eq + ?Sized
[src]

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 + ?Sized
[src]

impl<Ret, A, B, C, D> Eq for unsafe extern "C" fn(A, B, C, D, ...) -> Ret
[src]

impl<'a, A> Eq for &'a A where
    A: Eq + ?Sized
[src]

impl<Ret, A, B, C, D, E> Eq for extern "C" fn(A, B, C, D, E, ...) -> Ret
[src]

impl Eq for NonZeroU32
[src]

impl Eq for i8x64
[src]

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
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret
[src]

impl<A, B, C, D, E> Eq for (A, B, C, D, E) where
    A: Eq,
    B: Eq,
    C: Eq,
    D: Eq,
    E: Eq + ?Sized
[src]

impl Eq for u32x4
[src]

impl Eq for m8x8
[src]

impl<Ret, A, B, C, D> Eq for unsafe extern "C" fn(A, B, C, D) -> Ret
[src]

impl<Ret, A, B, C> Eq for fn(A, B, C) -> Ret
[src]

impl Eq for UnicodeVersion
[src]

impl Eq for NonZeroU64
[src]

impl<T> Eq for [T; 18] where
    T: Eq
[src]

impl Eq for u64
[src]

impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe fn(A, B, C, D, E, F, G, H) -> Ret
[src]

impl<T> Eq for [T; 26] where
    T: Eq
[src]

impl Eq for i64x2
[src]

impl<T> Eq for [T; 0] where
    T: Eq
[src]

impl<T> Eq for [T; 27] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E, F> Eq for fn(A, B, C, D, E, F) -> Ret
[src]

impl<T> Eq for [T; 28] where
    T: Eq
[src]

impl Eq for m16x4
[src]

impl<Ret> Eq for fn() -> Ret
[src]

impl Eq for m1x16
[src]

impl Eq for !
[src]

impl Eq for m1x64
[src]

impl<T> Eq for [T; 6] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, ...) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H) -> Ret
[src]

impl<T> Eq for [T; 2] where
    T: Eq
[src]

impl Eq for i32x8
[src]

impl Eq for u8
[src]

impl Eq for i16x2
[src]

impl Eq for NonZeroI16
[src]

impl Eq for u8x8
[src]

impl Eq for ParseCharError
[src]

impl Eq for Layout
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, ...) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, ...) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, ...) -> Ret
[src]

impl<Ret> Eq for unsafe extern "C" fn() -> Ret
[src]

impl Eq for NonZeroU128
[src]

impl Eq for m64x2
[src]

impl Eq for i64x8
[src]

impl<Ret, A, B, C, D, E, F> Eq for extern "C" fn(A, B, C, D, E, F, ...) -> Ret
[src]

impl Eq for m8x2
[src]

impl Eq for i16x4
[src]

impl<T> Eq for NonZero<T> where
    T: Zeroable + Eq
[src]

impl Eq for AllocErr
[src]

impl<Ret> Eq for extern "C" fn() -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G> Eq for fn(A, B, C, D, E, F, G) -> Ret
[src]

impl<Ret, A, B, C, D, E, F> Eq for unsafe fn(A, B, C, D, E, F) -> Ret
[src]

impl<Ret, A, B, C> Eq for extern "C" fn(A, B, C) -> Ret
[src]

impl Eq for InvalidSequence
[src]

impl<T> Eq for Wrapping<T> where
    T: Eq
[src]

impl<T> Eq for *const T where
    T: ?Sized
[src]

impl<Ret, A, B, C, D, E, F, G> Eq for unsafe fn(A, B, C, D, E, F, G) -> Ret
[src]

impl Eq for Duration
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, ...) -> Ret
[src]

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 + ?Sized
[src]

impl<T> Eq for [T; 30] where
    T: Eq
[src]

impl Eq for u8x16
[src]

impl Eq for u8x2
[src]

impl<T> Eq for RefCell<T> where
    T: Eq + ?Sized
[src]

impl<T> Eq for [T; 23] where
    T: Eq
[src]

impl Eq for m16x16
[src]

impl<Ret, A, B, C> Eq for extern "C" fn(A, B, C, ...) -> Ret
[src]

impl Eq for u16x2
[src]

impl Eq for m8x4
[src]

impl<'a, A> Eq for &'a mut A where
    A: Eq + ?Sized
[src]

impl Eq for u8x64
[src]

impl Eq for NonZeroU16
[src]

impl<'a> Eq for Utf8LossyChunk<'a>
[src]

impl Eq for m1x8
[src]

impl<Ret, A, B> Eq for extern "C" fn(A, B) -> Ret
[src]

impl Eq for NonZeroIsize
[src]

impl<Ret, A, B, C, D> Eq for unsafe fn(A, B, C, D) -> Ret
[src]

impl<Ret, A, B, C, D, E> Eq for unsafe fn(A, B, C, D, E) -> Ret
[src]

impl<T> Eq for [T; 29] where
    T: Eq
[src]

impl<Ret, A> Eq for unsafe fn(A) -> Ret
[src]

impl<Ret, A, B, C, D, E, F> Eq for unsafe extern "C" fn(A, B, C, D, E, F) -> Ret
[src]

impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret
[src]

impl<T> Eq for [T; 16] where
    T: Eq
[src]

impl Eq for FpCategory
[src]

impl<Ret, A, B> Eq for extern "C" fn(A, B, ...) -> Ret
[src]

impl Eq for u8x32
[src]

impl Eq for u64x8
[src]

impl<T> Eq for [T; 21] where
    T: Eq
[src]

impl<Ret, A, B, C, D> Eq for fn(A, B, C, D) -> Ret
[src]

impl<Ret, A, B, C, D, E> Eq for fn(A, B, C, D, E) -> Ret
[src]

impl Eq for i8x4
[src]

impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I) -> Ret
[src]

impl Eq for TypeId
[src]

impl Eq for NonZeroI8
[src]

impl Eq for NonZeroI32
[src]

impl<Ret, A, B, C> Eq for unsafe extern "C" fn(A, B, C, ...) -> Ret
[src]

impl Eq for NonZeroU8
[src]

impl Eq for u128
[src]

impl Eq for i128
[src]

impl<Ret, A> Eq for unsafe extern "C" fn(A, ...) -> Ret
[src]

impl<Ret, A> Eq for extern "C" fn(A) -> Ret
[src]

impl<T> Eq for [T; 12] where
    T: Eq
[src]

impl<T> Eq for [T; 32] where
    T: Eq
[src]

impl Eq for NonZeroI128
[src]

impl<Ret, A> Eq for unsafe extern "C" fn(A) -> Ret
[src]

impl<Ret, A, B, C, D, E> Eq for extern "C" fn(A, B, C, D, E) -> Ret
[src]

impl Eq for u16x4
[src]

impl Eq for u16x16
[src]

impl<T> Eq for PhantomData<T> where
    T: ?Sized
[src]

impl<T> Eq for [T; 9] where
    T: Eq
[src]

impl<Ret, A, B, C, D, E, F, G, H> Eq for extern "C" fn(A, B, C, D, E, F, G, H, ...) -> Ret
[src]

impl<Ret, A> Eq for extern "C" fn(A, ...) -> Ret
[src]

impl Eq for i32
[src]

impl<A> Eq for (A,) where
    A: Eq + ?Sized
[src]

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 + ?Sized
[src]

impl<T> Eq for [T; 10] where
    T: Eq
[src]

impl<T> Eq for [T; 14] where
    T: Eq
[src]

impl Eq for i32x16
[src]

impl Eq for CharTryFromError
[src]

impl Eq for i16
[src]

impl Eq for i8x8
[src]

impl<T> Eq for [T; 1] where
    T: Eq
[src]

impl<T> Eq for [T; 24] where
    T: Eq
[src]

impl<Ret, A, B, C, D> Eq for extern "C" fn(A, B, C, D) -> Ret
[src]

impl Eq for u64x4
[src]

impl Eq for u64x2
[src]

impl<'a, B> Eq for Cow<'a, B> where
    B: Eq + ToOwned + ?Sized
[src]

impl<T> Eq for Arc<T> where
    T: Eq + ?Sized
[src]

impl<T> Eq for Rc<T> where
    T: Eq + ?Sized
[src]

Implementors