pub trait PartialEq<Rhs = Self>where
Rhs: ?Sized,{
// Required method
fn eq(&self, other: &Rhs) -> bool;
// Provided method
fn ne(&self, other: &Rhs) -> bool { ... }
}
Expand description
Trait for comparisons using the equality operator.
Implementing this trait for types provides the ==
and !=
operators for
those types.
x.eq(y)
can also be written x == y
, and x.ne(y)
can be written x != y
.
We use the easier-to-read infix notation in the remainder of this documentation.
This trait allows for comparisons using the equality operator, 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 speaking, when Rhs == Self
, this trait corresponds
to a partial equivalence relation.
Implementations must ensure that eq
and ne
are consistent with each other:
a != b
if and only if!(a == b)
.
The default implementation of ne
provides this consistency and is almost
always sufficient. It should not be overridden without very good reason.
If PartialOrd
or Ord
are also implemented for Self
and Rhs
, their methods must also
be consistent with PartialEq
(see the documentation of those traits for the exact
requirements). It’s easy to accidentally make them disagree by deriving some of the traits and
manually implementing others.
The equality relation ==
must satisfy the following conditions
(for all a
, b
, c
of type A
, B
, C
):
-
Symmetry: if
A: PartialEq<B>
andB: PartialEq<A>
, thena == b
impliesb == a
; and -
Transitivity: if
A: PartialEq<B>
andB: PartialEq<C>
andA: PartialEq<C>
, thena == b
andb == c
impliesa == c
. This must also work for longer chains, such as whenA: PartialEq<B>
,B: PartialEq<C>
,C: PartialEq<D>
, andA: PartialEq<D>
all exist.
Note that the B: PartialEq<A>
(symmetric) and A: PartialEq<C>
(transitive) impls are not forced to exist, but these requirements apply
whenever they do exist.
Violating these requirements is a logic error. The behavior resulting from a logic error is not
specified, but users of the trait must ensure that such logic errors do not result in
undefined behavior. This means that unsafe
code must not rely on the correctness of these
methods.
§Cross-crate considerations
Upholding the requirements stated above can become tricky when one crate implements PartialEq
for a type of another crate (i.e., to allow comparing one of its own types with a type from the
standard library). The recommendation is to never implement this trait for a foreign type. In
other words, such a crate should do impl PartialEq<ForeignType> for LocalType
, but it should
not do impl PartialEq<LocalType> for ForeignType
.
This avoids the problem of transitive chains that criss-cross crate boundaries: for all local
types T
, you may assume that no other crate will add impl
s that allow comparing T == U
. In
other words, if other crates add impl
s that allow building longer transitive chains U1 == ... == T == V1 == ...
, then all the types that appear to the right of T
must be types that the
crate defining T
already knows about. This rules out transitive chains where downstream crates
can add new impl
s that “stitch together” comparisons of foreign types in ways that violate
transitivity.
Not having such foreign impl
s also avoids forward compatibility issues where one crate adding
more PartialEq
implementations can cause build failures in downstream crates.
§Derivable
This trait can be used with #[derive]
. When derive
d on structs, two
instances are equal if all fields are equal, and not equal if any fields
are not equal. When derive
d on enums, two instances are equal if they
are the same variant and all fields are equal.
§How can I implement PartialEq
?
An example implementation for a domain in which two books are considered the same book if their ISBN matches, even if the formats differ:
enum BookFormat {
Paperback,
Hardback,
Ebook,
}
struct Book {
isbn: i32,
format: BookFormat,
}
impl PartialEq for Book {
fn eq(&self, other: &Self) -> bool {
self.isbn == other.isbn
}
}
let b1 = Book { isbn: 3, format: BookFormat::Paperback };
let b2 = Book { isbn: 3, format: BookFormat::Ebook };
let b3 = Book { isbn: 10, format: BookFormat::Paperback };
assert!(b1 == b2);
assert!(b1 != b3);
§How can I compare two different types?
The type you can compare with is controlled by PartialEq
’s type parameter.
For example, let’s tweak our previous code a bit:
// The derive implements <BookFormat> == <BookFormat> comparisons
#[derive(PartialEq)]
enum BookFormat {
Paperback,
Hardback,
Ebook,
}
struct Book {
isbn: i32,
format: BookFormat,
}
// Implement <Book> == <BookFormat> comparisons
impl PartialEq<BookFormat> for Book {
fn eq(&self, other: &BookFormat) -> bool {
self.format == *other
}
}
// Implement <BookFormat> == <Book> comparisons
impl PartialEq<Book> for BookFormat {
fn eq(&self, other: &Book) -> bool {
*self == other.format
}
}
let b1 = Book { isbn: 3, format: BookFormat::Paperback };
assert!(b1 == BookFormat::Paperback);
assert!(BookFormat::Ebook != b1);
By changing impl PartialEq for Book
to impl PartialEq<BookFormat> for Book
,
we allow BookFormat
s to be compared with Book
s.
A comparison like the one above, which ignores some fields of the struct,
can be dangerous. It can easily lead to an unintended violation of the
requirements for a partial equivalence relation. For example, if we kept
the above implementation of PartialEq<Book>
for BookFormat
and added an
implementation of PartialEq<Book>
for Book
(either via a #[derive]
or
via the manual implementation from the first example) then the result would
violate transitivity:
#[derive(PartialEq)]
enum BookFormat {
Paperback,
Hardback,
Ebook,
}
#[derive(PartialEq)]
struct Book {
isbn: i32,
format: BookFormat,
}
impl PartialEq<BookFormat> for Book {
fn eq(&self, other: &BookFormat) -> bool {
self.format == *other
}
}
impl PartialEq<Book> for BookFormat {
fn eq(&self, other: &Book) -> bool {
*self == other.format
}
}
fn main() {
let b1 = Book { isbn: 1, format: BookFormat::Paperback };
let b2 = Book { isbn: 2, format: BookFormat::Paperback };
assert!(b1 == BookFormat::Paperback);
assert!(BookFormat::Paperback == b2);
// The following should hold by transitivity but doesn't.
assert!(b1 == b2); // <-- PANICS
}
§Examples
let x: u32 = 0;
let y: u32 = 1;
assert_eq!(x == y, false);
assert_eq!(x.eq(&y), false);
Required Methods§
Provided Methods§
Implementors§
impl PartialEq for AhoCorasickKind
impl PartialEq for aho_corasick::packed::api::MatchKind
impl PartialEq for aho_corasick::util::error::MatchErrorKind
impl PartialEq for aho_corasick::util::search::Anchored
impl PartialEq for aho_corasick::util::search::MatchKind
impl PartialEq for StartKind
impl PartialEq for crossbeam_channel::err::RecvTimeoutError
impl PartialEq for crossbeam_channel::err::TryRecvError
impl PartialEq for BernoulliError
impl PartialEq for rand::distr::uniform::Error
impl PartialEq for rand::distr::weighted::Error
impl PartialEq for IndexVec
impl PartialEq for regex::error::Error
impl PartialEq for State
impl PartialEq for regex_automata::util::look::Look
impl PartialEq for regex_automata::util::search::Anchored
impl PartialEq for regex_automata::util::search::MatchErrorKind
impl PartialEq for regex_automata::util::search::MatchKind
impl PartialEq for AssertionKind
impl PartialEq for Ast
impl PartialEq for ClassAsciiKind
impl PartialEq for ClassPerlKind
impl PartialEq for ClassSet
impl PartialEq for ClassSetBinaryOpKind
impl PartialEq for ClassSetItem
impl PartialEq for ClassUnicodeKind
impl PartialEq for ClassUnicodeOpKind
impl PartialEq for regex_syntax::ast::ErrorKind
impl PartialEq for Flag
impl PartialEq for FlagsItemKind
impl PartialEq for GroupKind
impl PartialEq for HexLiteralKind
impl PartialEq for LiteralKind
impl PartialEq for RepetitionKind
impl PartialEq for RepetitionRange
impl PartialEq for SpecialLiteralKind
impl PartialEq for regex_syntax::error::Error
impl PartialEq for Class
impl PartialEq for Dot
impl PartialEq for regex_syntax::hir::ErrorKind
impl PartialEq for HirKind
impl PartialEq for regex_syntax::hir::Look
impl PartialEq for Utf8Sequence
impl PartialEq for zerocopy::byteorder::BigEndian
impl PartialEq for zerocopy::byteorder::LittleEndian
impl PartialEq for AsciiChar
impl PartialEq for BacktraceStatus
impl PartialEq for TryReserveErrorKind
impl PartialEq for Infallible
impl PartialEq for VarError
impl PartialEq for FromBytesWithNulError
impl PartialEq for cs431_homework::test::loom::fmt::Alignment
impl PartialEq for DebugAsHex
impl PartialEq for Sign
impl PartialEq for cs431_homework::test::loom::io::ErrorKind
impl PartialEq for SeekFrom
impl PartialEq for IpAddr
impl PartialEq for Ipv6MulticastScope
impl PartialEq for Shutdown
impl PartialEq for SocketAddr
impl PartialEq for FpCategory
impl PartialEq for IntErrorKind
impl PartialEq for BacktraceStyle
impl PartialEq for GetDisjointMutError
impl PartialEq for SearchStep
impl PartialEq for cs431_homework::test::loom::sync::atomic::Ordering
impl PartialEq for cs431_homework::test::loom::sync::mpmc::RecvTimeoutError
impl PartialEq for cs431_homework::test::loom::sync::mpmc::TryRecvError
impl PartialEq for cs431_homework::test::loom::cmp::Ordering
impl PartialEq for bool
impl PartialEq for char
impl PartialEq for f16
impl PartialEq for f32
impl PartialEq for f64
impl PartialEq for f128
impl PartialEq for i8
impl PartialEq for i16
impl PartialEq for i32
impl PartialEq for i64
impl PartialEq for i128
impl PartialEq for isize
impl PartialEq for !
impl PartialEq for str
impl PartialEq for u8
impl PartialEq for u16
impl PartialEq for u32
impl PartialEq for u64
impl PartialEq for u128
impl PartialEq for ()
impl PartialEq for usize
impl PartialEq for aho_corasick::util::error::MatchError
impl PartialEq for aho_corasick::util::primitives::PatternID
impl PartialEq for aho_corasick::util::primitives::PatternIDError
impl PartialEq for aho_corasick::util::primitives::StateID
impl PartialEq for aho_corasick::util::primitives::StateIDError
impl PartialEq for aho_corasick::util::search::Match
impl PartialEq for aho_corasick::util::search::Span
impl PartialEq for ReadyTimeoutError
impl PartialEq for crossbeam_channel::err::RecvError
impl PartialEq for SelectTimeoutError
impl PartialEq for TryReadyError
impl PartialEq for TrySelectError
impl PartialEq for Collector
impl PartialEq for getrandom::error::Error
impl PartialEq for Bernoulli
impl PartialEq for UniformUsize
impl PartialEq for UniformChar
impl PartialEq for UniformDuration
impl PartialEq for StepRng
impl PartialEq for SmallRng
impl PartialEq for StdRng
impl PartialEq for ChaCha8Core
impl PartialEq for ChaCha8Rng
impl PartialEq for ChaCha12Core
impl PartialEq for ChaCha12Rng
impl PartialEq for ChaCha20Core
impl PartialEq for ChaCha20Rng
impl PartialEq for OsError
impl PartialEq for OverlappingState
impl PartialEq for LazyStateID
impl PartialEq for DenseTransitions
impl PartialEq for SparseTransitions
impl PartialEq for Transition
impl PartialEq for Unit
impl PartialEq for regex_automata::util::look::LookSet
impl PartialEq for NonMaxUsize
impl PartialEq for regex_automata::util::primitives::PatternID
impl PartialEq for regex_automata::util::primitives::PatternIDError
impl PartialEq for SmallIndex
impl PartialEq for SmallIndexError
impl PartialEq for regex_automata::util::primitives::StateID
impl PartialEq for regex_automata::util::primitives::StateIDError
impl PartialEq for HalfMatch
impl PartialEq for regex_automata::util::search::Match
impl PartialEq for regex_automata::util::search::MatchError
impl PartialEq for PatternSet
impl PartialEq for regex_automata::util::search::Span
impl PartialEq for Alternation
impl PartialEq for Assertion
impl PartialEq for CaptureName
impl PartialEq for ClassAscii
impl PartialEq for ClassBracketed
impl PartialEq for ClassPerl
impl PartialEq for ClassSetBinaryOp
impl PartialEq for ClassSetRange
impl PartialEq for ClassSetUnion
impl PartialEq for regex_syntax::ast::ClassUnicode
impl PartialEq for Comment
impl PartialEq for Concat
impl PartialEq for regex_syntax::ast::Error
impl PartialEq for Flags
impl PartialEq for FlagsItem
impl PartialEq for Group
impl PartialEq for regex_syntax::ast::Literal
impl PartialEq for Position
impl PartialEq for regex_syntax::ast::Repetition
impl PartialEq for RepetitionOp
impl PartialEq for SetFlags
impl PartialEq for regex_syntax::ast::Span
impl PartialEq for WithComments
impl PartialEq for regex_syntax::hir::literal::Literal
impl PartialEq for Seq
impl PartialEq for Capture
impl PartialEq for ClassBytes
impl PartialEq for ClassBytesRange
impl PartialEq for regex_syntax::hir::ClassUnicode
impl PartialEq for ClassUnicodeRange
impl PartialEq for regex_syntax::hir::Error
impl PartialEq for Hir
impl PartialEq for regex_syntax::hir::Literal
impl PartialEq for regex_syntax::hir::LookSet
impl PartialEq for Properties
impl PartialEq for regex_syntax::hir::Repetition
impl PartialEq for Utf8Range
impl PartialEq for zerocopy::error::AllocError
impl PartialEq for Request
impl PartialEq for cs431_homework::test::loom::alloc::AllocError
impl PartialEq for Layout
impl PartialEq for LayoutError
impl PartialEq for TypeId
impl PartialEq for CpuidResult
impl PartialEq for ByteStr
impl PartialEq for ByteString
impl PartialEq for CharTryFromError
impl PartialEq for DecodeUtf16Error
impl PartialEq for ParseCharError
impl PartialEq for TryFromCharError
impl PartialEq for UnorderedKeyError
impl PartialEq for TryReserveError
impl PartialEq for CStr
impl PartialEq for CString
impl PartialEq for FromBytesUntilNulError
impl PartialEq for FromVecWithNulError
impl PartialEq for IntoStringError
impl PartialEq for NulError
impl PartialEq for OsStr
impl PartialEq for OsString
impl PartialEq for cs431_homework::test::loom::fmt::Error
impl PartialEq for FormattingOptions
impl PartialEq for FileType
impl PartialEq for Permissions
impl PartialEq for PhantomPinned
impl PartialEq for Assume
impl PartialEq for AddrParseError
impl PartialEq for Ipv4Addr
impl PartialEq for Ipv6Addr
impl PartialEq for SocketAddrV4
impl PartialEq for SocketAddrV6
impl PartialEq for ParseFloatError
impl PartialEq for ParseIntError
impl PartialEq for TryFromIntError
impl PartialEq for RangeFull
impl PartialEq for UCred
impl PartialEq for Path
impl PartialEq for PathBuf
impl PartialEq for StripPrefixError
impl PartialEq for ExitCode
impl PartialEq for ExitStatus
impl PartialEq for ExitStatusError
impl PartialEq for Output
impl PartialEq for cs431_homework::test::loom::ptr::Alignment
impl PartialEq for ParseBoolError
impl PartialEq for Utf8Error
impl PartialEq for FromUtf8Error
impl PartialEq for String
impl PartialEq for cs431_homework::test::loom::sync::mpmc::RecvError
impl PartialEq for WaitTimeoutResult
impl PartialEq for RawWaker
impl PartialEq for RawWakerVTable
impl PartialEq for AccessError
impl PartialEq for ThreadId
impl PartialEq for Duration
impl PartialEq for Instant
impl PartialEq for SystemTime
impl PartialEq for TryFromFloatSecsError
impl PartialEq for vec128_storage
impl PartialEq for vec256_storage
impl PartialEq for vec512_storage
impl PartialEq for BigEndian
impl PartialEq for LittleEndian
impl PartialEq<&str> for OsString
impl PartialEq<IpAddr> for Ipv4Addr
impl PartialEq<IpAddr> for Ipv6Addr
impl PartialEq<str> for OsStr
impl PartialEq<str> for OsString
impl PartialEq<Span> for cs431_homework::test::loom::ops::Range<usize>
impl PartialEq<Span> for cs431_homework::test::loom::ops::Range<usize>
impl PartialEq<OsStr> for str
impl PartialEq<OsStr> for Path
impl PartialEq<OsStr> for PathBuf
impl PartialEq<OsString> for str
impl PartialEq<OsString> for Path
impl PartialEq<OsString> for PathBuf
impl PartialEq<Ipv4Addr> for IpAddr
impl PartialEq<Ipv6Addr> for IpAddr
impl PartialEq<Range<usize>> for aho_corasick::util::search::Span
impl PartialEq<Range<usize>> for regex_automata::util::search::Span
impl PartialEq<Path> for OsStr
impl PartialEq<Path> for OsString
impl PartialEq<Path> for PathBuf
impl PartialEq<PathBuf> for OsStr
impl PartialEq<PathBuf> for OsString
impl PartialEq<PathBuf> for Path
impl<'a> PartialEq for Component<'a>
impl<'a> PartialEq for Prefix<'a>
impl<'a> PartialEq for Utf8Pattern<'a>
impl<'a> PartialEq for PhantomContravariantLifetime<'a>
impl<'a> PartialEq for PhantomCovariantLifetime<'a>
impl<'a> PartialEq for PhantomInvariantLifetime<'a>
impl<'a> PartialEq for Location<'a>
impl<'a> PartialEq for Components<'a>
impl<'a> PartialEq for PrefixComponent<'a>
impl<'a> PartialEq for Utf8Chunk<'a>
impl<'a> PartialEq<&'a ByteStr> for Cow<'a, str>
impl<'a> PartialEq<&'a ByteStr> for Cow<'a, ByteStr>
impl<'a> PartialEq<&'a ByteStr> for Cow<'a, [u8]>
impl<'a> PartialEq<&'a OsStr> for Path
impl<'a> PartialEq<&'a OsStr> for PathBuf
impl<'a> PartialEq<&'a Path> for OsStr
impl<'a> PartialEq<&'a Path> for OsString
impl<'a> PartialEq<&'a Path> for PathBuf
impl<'a> PartialEq<&str> for ByteStr
impl<'a> PartialEq<&str> for ByteString
impl<'a> PartialEq<&ByteStr> for ByteString
impl<'a> PartialEq<&[u8]> for ByteStr
impl<'a> PartialEq<&[u8]> for ByteString
impl<'a> PartialEq<Cow<'_, str>> for ByteString
impl<'a> PartialEq<Cow<'_, ByteStr>> for ByteString
impl<'a> PartialEq<Cow<'_, [u8]>> for ByteString
impl<'a> PartialEq<Cow<'a, str>> for &'a ByteStr
impl<'a> PartialEq<Cow<'a, ByteStr>> for &'a ByteStr
impl<'a> PartialEq<Cow<'a, OsStr>> for Path
impl<'a> PartialEq<Cow<'a, OsStr>> for PathBuf
impl<'a> PartialEq<Cow<'a, Path>> for OsStr
impl<'a> PartialEq<Cow<'a, Path>> for OsString
impl<'a> PartialEq<Cow<'a, Path>> for Path
impl<'a> PartialEq<Cow<'a, Path>> for PathBuf
impl<'a> PartialEq<Cow<'a, [u8]>> for &'a ByteStr
impl<'a> PartialEq<str> for ByteStr
impl<'a> PartialEq<str> for ByteString
impl<'a> PartialEq<ByteStr> for &str
impl<'a> PartialEq<ByteStr> for &[u8]
impl<'a> PartialEq<ByteStr> for str
impl<'a> PartialEq<ByteStr> for ByteString
impl<'a> PartialEq<ByteStr> for String
impl<'a> PartialEq<ByteStr> for Vec<u8>
impl<'a> PartialEq<ByteStr> for [u8]
impl<'a> PartialEq<ByteString> for &str
impl<'a> PartialEq<ByteString> for &ByteStr
impl<'a> PartialEq<ByteString> for &[u8]
impl<'a> PartialEq<ByteString> for Cow<'_, str>
impl<'a> PartialEq<ByteString> for Cow<'_, ByteStr>
impl<'a> PartialEq<ByteString> for Cow<'_, [u8]>
impl<'a> PartialEq<ByteString> for str
impl<'a> PartialEq<ByteString> for ByteStr
impl<'a> PartialEq<ByteString> for String
impl<'a> PartialEq<ByteString> for Vec<u8>
impl<'a> PartialEq<ByteString> for [u8]
impl<'a> PartialEq<OsStr> for &'a Path
impl<'a> PartialEq<OsStr> for Cow<'a, Path>
impl<'a> PartialEq<OsString> for &'a str
impl<'a> PartialEq<OsString> for &'a Path
impl<'a> PartialEq<OsString> for Cow<'a, Path>
impl<'a> PartialEq<Path> for &'a OsStr
impl<'a> PartialEq<Path> for Cow<'a, OsStr>
impl<'a> PartialEq<Path> for Cow<'a, Path>
impl<'a> PartialEq<PathBuf> for &'a OsStr
impl<'a> PartialEq<PathBuf> for &'a Path
impl<'a> PartialEq<PathBuf> for Cow<'a, OsStr>
impl<'a> PartialEq<PathBuf> for Cow<'a, Path>
impl<'a> PartialEq<String> for ByteStr
impl<'a> PartialEq<String> for ByteString
impl<'a> PartialEq<Vec<u8>> for ByteStr
impl<'a> PartialEq<Vec<u8>> for ByteString
impl<'a> PartialEq<[u8]> for ByteStr
impl<'a> PartialEq<[u8]> for ByteString
impl<'a, 'b> PartialEq<&'a str> for String
impl<'a, 'b> PartialEq<&'a OsStr> for OsString
impl<'a, 'b> PartialEq<&'a Path> for Cow<'b, OsStr>
impl<'a, 'b> PartialEq<&'b str> for Cow<'a, str>
impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, OsStr>
impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, Path>
impl<'a, 'b> PartialEq<&'b Path> for Cow<'a, Path>
impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b str
impl<'a, 'b> PartialEq<Cow<'a, str>> for str
impl<'a, 'b> PartialEq<Cow<'a, str>> for String
impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for &'b OsStr
impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsStr
impl<'a, 'b> PartialEq<Cow<'a, OsStr>> for OsString
impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b OsStr
impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b Path
impl<'a, 'b> PartialEq<Cow<'b, OsStr>> for &'a Path
impl<'a, 'b> PartialEq<str> for Cow<'a, str>
impl<'a, 'b> PartialEq<str> for String
impl<'a, 'b> PartialEq<OsStr> for Cow<'a, OsStr>
impl<'a, 'b> PartialEq<OsStr> for OsString
impl<'a, 'b> PartialEq<OsString> for &'a OsStr
impl<'a, 'b> PartialEq<OsString> for Cow<'a, OsStr>
impl<'a, 'b> PartialEq<OsString> for OsStr
impl<'a, 'b> PartialEq<String> for &'a str
impl<'a, 'b> PartialEq<String> for Cow<'a, str>
impl<'a, 'b> PartialEq<String> for str
impl<'a, 'b, B, C> PartialEq<Cow<'b, C>> for Cow<'a, B>
impl<'h> PartialEq for regex::regex::bytes::Match<'h>
impl<'h> PartialEq for regex::regex::string::Match<'h>
impl<'r, R> PartialEq for UnwrapMut<'r, R>
impl<A, B> PartialEq<&B> for &A
impl<A, B> PartialEq<&B> for &mut A
impl<A, B> PartialEq<&mut B> for &A
impl<A, B> PartialEq<&mut B> for &mut A
impl<A, S, V> PartialEq for ConvertError<A, S, V>
impl<B, C> PartialEq for ControlFlow<B, C>
impl<Dyn> PartialEq for DynMetadata<Dyn>where
Dyn: ?Sized,
impl<F> PartialEq for Fwhere
F: FnPtr,
impl<H> PartialEq for BuildHasherDefault<H>
impl<Idx> PartialEq for cs431_homework::test::loom::ops::Range<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for cs431_homework::test::loom::ops::RangeFrom<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for cs431_homework::test::loom::ops::RangeInclusive<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for RangeTo<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for RangeToInclusive<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for cs431_homework::test::loom::range::Range<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for cs431_homework::test::loom::range::RangeFrom<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for cs431_homework::test::loom::range::RangeInclusive<Idx>where
Idx: PartialEq,
impl<K, V, A> PartialEq for BTreeMap<K, V, A>
impl<K, V, S> PartialEq for HashMap<K, V, S>
impl<O> PartialEq for zerocopy::byteorder::F32<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::F32<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::F64<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::F64<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I16<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I16<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I32<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I32<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I64<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I64<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I128<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::I128<O>where
O: PartialEq,
impl<O> PartialEq for Isize<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U16<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U16<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U32<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U32<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U64<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U64<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U128<O>where
O: PartialEq,
impl<O> PartialEq for zerocopy::byteorder::U128<O>where
O: PartialEq,
impl<O> PartialEq for Usize<O>where
O: PartialEq,
impl<O> PartialEq<f32> for zerocopy::byteorder::F32<O>where
O: ByteOrder,
impl<O> PartialEq<f64> for zerocopy::byteorder::F64<O>where
O: ByteOrder,
impl<O> PartialEq<i16> for zerocopy::byteorder::I16<O>where
O: ByteOrder,
impl<O> PartialEq<i32> for zerocopy::byteorder::I32<O>where
O: ByteOrder,
impl<O> PartialEq<i64> for zerocopy::byteorder::I64<O>where
O: ByteOrder,
impl<O> PartialEq<i128> for zerocopy::byteorder::I128<O>where
O: ByteOrder,
impl<O> PartialEq<isize> for Isize<O>where
O: ByteOrder,
impl<O> PartialEq<u16> for zerocopy::byteorder::U16<O>where
O: ByteOrder,
impl<O> PartialEq<u32> for zerocopy::byteorder::U32<O>where
O: ByteOrder,
impl<O> PartialEq<u64> for zerocopy::byteorder::U64<O>where
O: ByteOrder,
impl<O> PartialEq<u128> for zerocopy::byteorder::U128<O>where
O: ByteOrder,
impl<O> PartialEq<usize> for Usize<O>where
O: ByteOrder,
impl<O> PartialEq<F32<O>> for [u8; 4]
impl<O> PartialEq<F32<O>> for [u8; 4]where
O: ByteOrder,
impl<O> PartialEq<F64<O>> for [u8; 8]
impl<O> PartialEq<F64<O>> for [u8; 8]where
O: ByteOrder,
impl<O> PartialEq<I16<O>> for [u8; 2]
impl<O> PartialEq<I16<O>> for [u8; 2]where
O: ByteOrder,
impl<O> PartialEq<I32<O>> for [u8; 4]
impl<O> PartialEq<I32<O>> for [u8; 4]where
O: ByteOrder,
impl<O> PartialEq<I64<O>> for [u8; 8]
impl<O> PartialEq<I64<O>> for [u8; 8]where
O: ByteOrder,
impl<O> PartialEq<I128<O>> for [u8; 16]
impl<O> PartialEq<I128<O>> for [u8; 16]where
O: ByteOrder,
impl<O> PartialEq<Isize<O>> for [u8; 8]
impl<O> PartialEq<U16<O>> for [u8; 2]
impl<O> PartialEq<U16<O>> for [u8; 2]where
O: ByteOrder,
impl<O> PartialEq<U32<O>> for [u8; 4]
impl<O> PartialEq<U32<O>> for [u8; 4]where
O: ByteOrder,
impl<O> PartialEq<U64<O>> for [u8; 8]
impl<O> PartialEq<U64<O>> for [u8; 8]where
O: ByteOrder,
impl<O> PartialEq<U128<O>> for [u8; 16]
impl<O> PartialEq<U128<O>> for [u8; 16]where
O: ByteOrder,
impl<O> PartialEq<Usize<O>> for [u8; 8]
impl<O> PartialEq<[u8; 2]> for zerocopy::byteorder::I16<O>
impl<O> PartialEq<[u8; 2]> for zerocopy::byteorder::I16<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 2]> for zerocopy::byteorder::U16<O>
impl<O> PartialEq<[u8; 2]> for zerocopy::byteorder::U16<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 4]> for zerocopy::byteorder::F32<O>
impl<O> PartialEq<[u8; 4]> for zerocopy::byteorder::F32<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 4]> for zerocopy::byteorder::I32<O>
impl<O> PartialEq<[u8; 4]> for zerocopy::byteorder::I32<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 4]> for zerocopy::byteorder::U32<O>
impl<O> PartialEq<[u8; 4]> for zerocopy::byteorder::U32<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 8]> for zerocopy::byteorder::F64<O>
impl<O> PartialEq<[u8; 8]> for zerocopy::byteorder::F64<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 8]> for zerocopy::byteorder::I64<O>
impl<O> PartialEq<[u8; 8]> for zerocopy::byteorder::I64<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 8]> for Isize<O>
impl<O> PartialEq<[u8; 8]> for zerocopy::byteorder::U64<O>
impl<O> PartialEq<[u8; 8]> for zerocopy::byteorder::U64<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 8]> for Usize<O>
impl<O> PartialEq<[u8; 16]> for zerocopy::byteorder::I128<O>
impl<O> PartialEq<[u8; 16]> for zerocopy::byteorder::I128<O>where
O: ByteOrder,
impl<O> PartialEq<[u8; 16]> for zerocopy::byteorder::U128<O>
impl<O> PartialEq<[u8; 16]> for zerocopy::byteorder::U128<O>where
O: ByteOrder,
impl<Ptr, Q> PartialEq<Pin<Q>> for Pin<Ptr>
impl<R> PartialEq for UnwrapErr<R>where
R: PartialEq + TryRngCore,
impl<Src, Dst> PartialEq for AlignmentError<Src, Dst>
impl<Src, Dst> PartialEq for SizeError<Src, Dst>
impl<Src, Dst> PartialEq for ValidityError<Src, Dst>
impl<T> PartialEq for crossbeam_channel::err::SendTimeoutError<T>where
T: PartialEq,
impl<T> PartialEq for crossbeam_channel::err::TrySendError<T>where
T: PartialEq,
impl<T> PartialEq for Bound<T>where
T: PartialEq,
impl<T> PartialEq for Option<T>where
T: PartialEq,
impl<T> PartialEq for cs431_homework::test::loom::sync::mpmc::SendTimeoutError<T>where
T: PartialEq,
impl<T> PartialEq for cs431_homework::test::loom::sync::mpmc::TrySendError<T>where
T: PartialEq,
impl<T> PartialEq for Poll<T>where
T: PartialEq,
impl<T> PartialEq for *const Twhere
T: ?Sized,
Pointer equality is by address, as produced by the <*const T>::addr
method.
impl<T> PartialEq for *mut Twhere
T: ?Sized,
Pointer equality is by address, as produced by the <*mut T>::addr
method.
impl<T> PartialEq for (T₁, T₂, …, Tₙ)
This trait is implemented for tuples up to twelve items long.