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 ConversionError
impl PartialEq for gstd::errors::CoreError
impl PartialEq for gstd::errors::Error
impl PartialEq for ErrorReplyReason
impl PartialEq for ExecutionError
impl PartialEq for ExtError
impl PartialEq for MemoryError
impl PartialEq for MessageError
impl PartialEq for ReplyCode
impl PartialEq for ReservationError
impl PartialEq for SignalCode
impl PartialEq for SimpleExecutionError
impl PartialEq for SimpleProgramCreationError
impl PartialEq for SuccessReplyReason
impl PartialEq for UsageError
impl PartialEq for AsciiChar
impl PartialEq for gstd::prelude::cmp::Ordering
impl PartialEq for TryReserveErrorKind
impl PartialEq for gstd::prelude::collections::hashbrown::TryReserveError
impl PartialEq for Infallible
impl PartialEq for gstd::prelude::fmt::Alignment
impl PartialEq for IpAddr
impl PartialEq for Ipv6MulticastScope
impl PartialEq for SocketAddr
impl PartialEq for core::sync::atomic::Ordering
impl PartialEq for BacktraceStatus
impl PartialEq for VarError
impl PartialEq for SeekFrom
impl PartialEq for ErrorKind
impl PartialEq for Shutdown
impl PartialEq for BacktraceStyle
impl PartialEq for RecvTimeoutError
impl PartialEq for TryRecvError
impl PartialEq for _Unwind_Action
impl PartialEq for _Unwind_Reason_Code
impl PartialEq for FromHexError
impl PartialEq for BernoulliError
impl PartialEq for WeightedError
impl PartialEq for IndexVec
impl PartialEq for FpCategory
impl PartialEq for IntErrorKind
impl PartialEq for SearchStep
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 gstd::errors::CodecError
impl PartialEq for ErrorReplyPayload
impl PartialEq for SyscallError
impl PartialEq for gstd::msg::MessageHandle
impl PartialEq for ActorId
impl PartialEq for CodeId
impl PartialEq for MessageId
impl PartialEq for Percent
impl PartialEq for ReservationId
impl PartialEq for MetaType
impl PartialEq for TypeId
impl PartialEq for CharTryFromError
impl PartialEq for DecodeUtf16Error
impl PartialEq for ParseCharError
impl PartialEq for TryFromCharError
impl PartialEq for UnorderedKeyError
impl PartialEq for gstd::prelude::collections::TryReserveError
impl PartialEq for CStr
impl PartialEq for CString
impl PartialEq for FromBytesUntilNulError
impl PartialEq for FromBytesWithNulError
impl PartialEq for FromVecWithNulError
impl PartialEq for IntoStringError
impl PartialEq for NulError
impl PartialEq for gstd::prelude::fmt::Error
impl PartialEq for Layout
impl PartialEq for LayoutError
impl PartialEq for core::alloc::AllocError
impl PartialEq for CpuidResult
impl PartialEq for Ipv4Addr
impl PartialEq for Ipv6Addr
impl PartialEq for AddrParseError
impl PartialEq for SocketAddrV4
impl PartialEq for SocketAddrV6
impl PartialEq for OsStr
impl PartialEq for OsString
impl PartialEq for FileType
impl PartialEq for Permissions
impl PartialEq for UCred
impl PartialEq for std::path::Path
impl PartialEq for PathBuf
impl PartialEq for StripPrefixError
impl PartialEq for ExitStatus
impl PartialEq for ExitStatusError
impl PartialEq for Output
impl PartialEq for WaitTimeoutResult
impl PartialEq for RecvError
impl PartialEq for AccessError
impl PartialEq for ThreadId
impl PartialEq for Instant
impl PartialEq for SystemTime
impl PartialEq for getrandom::error::Error
impl PartialEq for IgnoredAny
impl PartialEq for serde::de::value::Error
impl PartialEq for ATerm
impl PartialEq for B0
impl PartialEq for B1
impl PartialEq for Z0
impl PartialEq for Equal
impl PartialEq for Greater
impl PartialEq for Less
impl PartialEq for UTerm
impl PartialEq for Bernoulli
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 PhantomPinned
impl PartialEq for Assume
impl PartialEq for ParseFloatError
impl PartialEq for ParseIntError
impl PartialEq for TryFromIntError
impl PartialEq for RangeFull
impl PartialEq for gstd::prelude::ptr::Alignment
impl PartialEq for ParseBoolError
impl PartialEq for Utf8Error
impl PartialEq for FromUtf8Error
impl PartialEq for String
impl PartialEq for RawWaker
impl PartialEq for RawWakerVTable
impl PartialEq for Duration
impl PartialEq for TryFromFloatSecsError
impl PartialEq for Aborted
impl PartialEq for AllocError
impl PartialEq for BigEndian
impl PartialEq for Bytes
impl PartialEq for BytesMut
impl PartialEq for Canceled
impl PartialEq for Const
impl PartialEq for Dl_info
impl PartialEq for Elf32_Chdr
impl PartialEq for Elf32_Ehdr
impl PartialEq for Elf32_Phdr
impl PartialEq for Elf32_Shdr
impl PartialEq for Elf32_Sym
impl PartialEq for Elf64_Chdr
impl PartialEq for Elf64_Ehdr
impl PartialEq for Elf64_Phdr
impl PartialEq for Elf64_Shdr
impl PartialEq for Elf64_Sym
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for Error
impl PartialEq for FromDecStrErr
impl PartialEq for FromStrRadixErrKind
impl PartialEq for H128
impl PartialEq for H160
impl PartialEq for H256
impl PartialEq for H384
impl PartialEq for H512
impl PartialEq for H768
impl PartialEq for InvalidBufferSize
impl PartialEq for InvalidLength
impl PartialEq for LittleEndian
impl PartialEq for Lsb0
impl PartialEq for MacError
impl PartialEq for MessageHandle
impl PartialEq for MetaForm
impl PartialEq for Msb0
impl PartialEq for Mut
impl PartialEq for NonZeroU256
impl PartialEq for NullPtrError
impl PartialEq for ObjectIdentifier
impl PartialEq for OptionBool
impl PartialEq for PathError
impl PartialEq for PollNext
impl PartialEq for PortableForm
impl PartialEq for PortableRegistry
impl PartialEq for PortableType
impl PartialEq for Registry
impl PartialEq for SendError
impl PartialEq for TypeDefPrimitive
impl PartialEq for U128
impl PartialEq for U256
impl PartialEq for U512
impl PartialEq for __c_anonymous_ifru_map
impl PartialEq for __c_anonymous_ptrace_syscall_info_data
impl PartialEq for __c_anonymous_ptrace_syscall_info_entry
impl PartialEq for __c_anonymous_ptrace_syscall_info_exit
impl PartialEq for __c_anonymous_ptrace_syscall_info_seccomp
impl PartialEq for __c_anonymous_sockaddr_can_j1939
impl PartialEq for __c_anonymous_sockaddr_can_tp
impl PartialEq for __exit_status
impl PartialEq for __timeval
impl PartialEq for _libc_fpstate
impl PartialEq for _libc_fpxreg
impl PartialEq for _libc_xmmreg
impl PartialEq for addrinfo
impl PartialEq for af_alg_iv
impl PartialEq for aiocb
impl PartialEq for arpd_request
impl PartialEq for arphdr
impl PartialEq for arpreq
impl PartialEq for arpreq_old
impl PartialEq for can_filter
impl PartialEq for clone_args
impl PartialEq for cmsghdr
impl PartialEq for cpu_set_t
impl PartialEq for dirent
impl PartialEq for dirent64
impl PartialEq for dl_phdr_info
impl PartialEq for dqblk
impl PartialEq for epoll_event
impl PartialEq for fanotify_event_metadata
impl PartialEq for fanotify_response
impl PartialEq for fd_set
impl PartialEq for ff_condition_effect
impl PartialEq for ff_constant_effect
impl PartialEq for ff_effect
impl PartialEq for ff_envelope
impl PartialEq for ff_periodic_effect
impl PartialEq for ff_ramp_effect
impl PartialEq for ff_replay
impl PartialEq for ff_rumble_effect
impl PartialEq for ff_trigger
impl PartialEq for file_clone_range
impl PartialEq for flock
impl PartialEq for flock64
impl PartialEq for fsid_t
impl PartialEq for genlmsghdr
impl PartialEq for glob64_t
impl PartialEq for glob_t
impl PartialEq for group
impl PartialEq for hostent
impl PartialEq for hwtstamp_config
impl PartialEq for if_nameindex
impl PartialEq for ifaddrs
impl PartialEq for in6_addr
impl PartialEq for in6_ifreq
impl PartialEq for in6_pktinfo
impl PartialEq for in6_rtmsg
impl PartialEq for in_addr
impl PartialEq for in_pktinfo
impl PartialEq for inotify_event
impl PartialEq for input_absinfo
impl PartialEq for input_event
impl PartialEq for input_id
impl PartialEq for input_keymap_entry
impl PartialEq for input_mask
impl PartialEq for iocb
impl PartialEq for iovec
impl PartialEq for ip_mreq
impl PartialEq for ip_mreq_source
impl PartialEq for ip_mreqn
impl PartialEq for ipc_perm
impl PartialEq for ipv6_mreq
impl PartialEq for itimerspec
impl PartialEq for itimerval
impl PartialEq for j1939_filter
impl PartialEq for lconv
impl PartialEq for linger
impl PartialEq for mallinfo
impl PartialEq for mallinfo2
impl PartialEq for mcontext_t
impl PartialEq for mmsghdr
impl PartialEq for mntent
impl PartialEq for mq_attr
impl PartialEq for msghdr
impl PartialEq for msginfo
impl PartialEq for msqid_ds
impl PartialEq for nl_mmap_hdr
impl PartialEq for nl_mmap_req
impl PartialEq for nl_pktinfo
impl PartialEq for nlattr
impl PartialEq for nlmsgerr
impl PartialEq for nlmsghdr
impl PartialEq for ntptimeval
impl PartialEq for open_how
impl PartialEq for option
impl PartialEq for packet_mreq
impl PartialEq for passwd
impl PartialEq for pollfd
impl PartialEq for posix_spawn_file_actions_t
impl PartialEq for posix_spawnattr_t
impl PartialEq for protoent
impl PartialEq for pthread_attr_t
impl PartialEq for pthread_barrier_t
impl PartialEq for pthread_barrierattr_t
impl PartialEq for pthread_cond_t
impl PartialEq for pthread_condattr_t
impl PartialEq for pthread_mutex_t
impl PartialEq for pthread_mutexattr_t
impl PartialEq for pthread_rwlock_t
impl PartialEq for pthread_rwlockattr_t
impl PartialEq for ptrace_peeksiginfo_args
impl PartialEq for ptrace_rseq_configuration
impl PartialEq for ptrace_syscall_info
impl PartialEq for regex_t
impl PartialEq for regmatch_t
impl PartialEq for rlimit
impl PartialEq for rlimit64
impl PartialEq for rtentry
impl PartialEq for rusage
impl PartialEq for sched_attr
impl PartialEq for sched_param
impl PartialEq for sctp_authinfo
impl PartialEq for sctp_initmsg
impl PartialEq for sctp_nxtinfo
impl PartialEq for sctp_prinfo
impl PartialEq for sctp_rcvinfo
impl PartialEq for sctp_sndinfo
impl PartialEq for sctp_sndrcvinfo
impl PartialEq for seccomp_data
impl PartialEq for seccomp_notif
impl PartialEq for seccomp_notif_addfd
impl PartialEq for seccomp_notif_resp
impl PartialEq for seccomp_notif_sizes
impl PartialEq for sem_t
impl PartialEq for sembuf
impl PartialEq for semid_ds
impl PartialEq for seminfo
impl PartialEq for servent
impl PartialEq for shmid_ds
impl PartialEq for sigaction
impl PartialEq for sigevent
impl PartialEq for siginfo_t
impl PartialEq for signalfd_siginfo
impl PartialEq for sigset_t
impl PartialEq for sigval
impl PartialEq for sock_extended_err
impl PartialEq for sock_filter
impl PartialEq for sock_fprog
impl PartialEq for sockaddr
impl PartialEq for sockaddr_alg
impl PartialEq for sockaddr_in
impl PartialEq for sockaddr_in6
impl PartialEq for sockaddr_ll
impl PartialEq for sockaddr_nl
impl PartialEq for sockaddr_storage
impl PartialEq for sockaddr_un
impl PartialEq for sockaddr_vm
impl PartialEq for sockaddr_xdp
impl PartialEq for spwd
impl PartialEq for stack_t
impl PartialEq for stat
impl PartialEq for stat64
impl PartialEq for statfs
impl PartialEq for statfs64
impl PartialEq for statvfs
impl PartialEq for statvfs64
impl PartialEq for statx
impl PartialEq for statx_timestamp
impl PartialEq for sysinfo
impl PartialEq for termios
impl PartialEq for termios2
impl PartialEq for timespec
impl PartialEq for timeval
impl PartialEq for timex
impl PartialEq for tls12_crypto_info_aes_gcm_128
impl PartialEq for tls12_crypto_info_aes_gcm_256
impl PartialEq for tls12_crypto_info_chacha20_poly1305
impl PartialEq for tls_crypto_info
impl PartialEq for tm
impl PartialEq for tms
impl PartialEq for ucontext_t
impl PartialEq for ucred
impl PartialEq for uinput_abs_setup
impl PartialEq for uinput_ff_erase
impl PartialEq for uinput_ff_upload
impl PartialEq for uinput_setup
impl PartialEq for uinput_user_dev
impl PartialEq for user
impl PartialEq for user_fpregs_struct
impl PartialEq for user_regs_struct
impl PartialEq for utimbuf
impl PartialEq for utmpx
impl PartialEq for utsname
impl PartialEq for vec128_storage
impl PartialEq for vec256_storage
impl PartialEq for vec512_storage
impl PartialEq for winsize
impl PartialEq for xdp_desc
impl PartialEq for xdp_mmap_offsets
impl PartialEq for xdp_mmap_offsets_v1
impl PartialEq for xdp_options
impl PartialEq for xdp_ring_offset
impl PartialEq for xdp_ring_offset_v1
impl PartialEq for xdp_statistics
impl PartialEq for xdp_statistics_v1
impl PartialEq for xdp_umem_reg
impl PartialEq for xdp_umem_reg_v1
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<str> for Bytes
impl PartialEq<str> for BytesMut
impl PartialEq<Ipv4Addr> for IpAddr
impl PartialEq<Ipv6Addr> for IpAddr
impl PartialEq<OsStr> for str
impl PartialEq<OsStr> for std::path::Path
impl PartialEq<OsStr> for PathBuf
impl PartialEq<OsString> for str
impl PartialEq<OsString> for std::path::Path
impl PartialEq<OsString> for PathBuf
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 std::path::Path
impl PartialEq<String> for Bytes
impl PartialEq<String> for BytesMut
impl PartialEq<Vec<u8>> for Bytes
impl PartialEq<Vec<u8>> for BytesMut
impl PartialEq<Bytes> for &str
impl PartialEq<Bytes> for &[u8]
impl PartialEq<Bytes> for str
impl PartialEq<Bytes> for String
impl PartialEq<Bytes> for gstd::prelude::Vec<u8>
impl PartialEq<Bytes> for BytesMut
impl PartialEq<Bytes> for [u8]
impl PartialEq<BytesMut> for &str
impl PartialEq<BytesMut> for &[u8]
impl PartialEq<BytesMut> for str
impl PartialEq<BytesMut> for String
impl PartialEq<BytesMut> for gstd::prelude::Vec<u8>
impl PartialEq<BytesMut> for Bytes
impl PartialEq<BytesMut> for [u8]
impl PartialEq<[u8]> for Bytes
impl PartialEq<[u8]> for BytesMut
impl<'a> PartialEq for Component<'a>
impl<'a> PartialEq for Prefix<'a>
impl<'a> PartialEq for Unexpected<'a>
impl<'a> PartialEq for Components<'a>
impl<'a> PartialEq for PrefixComponent<'a>
impl<'a> PartialEq for Location<'a>
impl<'a> PartialEq for Utf8Chunk<'a>
impl<'a> PartialEq<&'a OsStr> for std::path::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<Cow<'a, OsStr>> for std::path::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 std::path::Path
impl<'a> PartialEq<Cow<'a, Path>> for PathBuf
impl<'a> PartialEq<OsStr> for &'a std::path::Path
impl<'a> PartialEq<OsStr> for Cow<'a, Path>
impl<'a> PartialEq<OsString> for &'a str
impl<'a> PartialEq<OsString> for &'a std::path::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 std::path::Path
impl<'a> PartialEq<PathBuf> for Cow<'a, OsStr>
impl<'a> PartialEq<PathBuf> for Cow<'a, Path>
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 std::path::Path
impl<'a, 'b> PartialEq<Cow<'b, OsStr>> for &'a std::path::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<'a, T> PartialEq for CompactRef<'a, T>where
T: PartialEq,
impl<'a, T> PartialEq for Symbol<'a, T>where
T: PartialEq + 'a,
impl<'a, T> PartialEq<&'a T> for Bytes
impl<'a, T> PartialEq<&'a T> for BytesMut
impl<'a, T, O> PartialEq for IterOnes<'a, T, O>
impl<'a, T, O> PartialEq for IterZeros<'a, T, O>
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, O, Rhs> PartialEq<Rhs> for BitArray<A, O>
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 core::range::Range<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for core::range::RangeFrom<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for core::range::RangeInclusive<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for gstd::prelude::ops::Range<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for gstd::prelude::ops::RangeFrom<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for gstd::prelude::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<Inner> PartialEq for Frozen<Inner>where
Inner: PartialEq + Mutability,
impl<K, V, A> PartialEq for BTreeMap<K, V, A>
impl<K, V, S> PartialEq for std::collections::hash::map::HashMap<K, V, S>
impl<K, V, S> PartialEq for AHashMap<K, V, S>
impl<K, V, S, A> PartialEq for gstd::prelude::collections::HashMap<K, V, S, A>
impl<M1, M2, O1, O2, T1, T2> PartialEq<BitRef<'_, M2, T2, O2>> for BitRef<'_, M1, T1, O1>where
M1: Mutability,
M2: Mutability,
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<M1, M2, O, T1, T2> PartialEq<BitPtrRange<M2, T2, O>> for BitPtrRange<M1, T1, O>where
M1: Mutability,
M2: Mutability,
O: BitOrder,
T1: BitStore,
T2: BitStore,
impl<M1, M2, T1, T2> PartialEq<Address<M2, T2>> for Address<M1, T1>where
M1: Mutability,
M2: Mutability,
impl<M1, M2, T1, T2, O> PartialEq<BitPtr<M2, T2, O>> for BitPtr<M1, T1, O>where
M1: Mutability,
M2: Mutability,
T1: BitStore,
T2: BitStore,
O: BitOrder,
impl<M, T, O> PartialEq<&bool> for BitRef<'_, M, T, O>where
M: Mutability,
T: BitStore,
O: BitOrder,
impl<M, T, O> PartialEq<bool> for BitRef<'_, M, T, O>where
M: Mutability,
T: BitStore,
O: BitOrder,
impl<M, T, O> PartialEq<BitRef<'_, M, T, O>> for &boolwhere
M: Mutability,
T: BitStore,
O: BitOrder,
impl<M, T, O> PartialEq<BitRef<'_, M, T, O>> for boolwhere
M: Mutability,
T: BitStore,
O: BitOrder,
impl<O1, A, O2, T> PartialEq<BitArray<A, O2>> for BitSlice<T, O1>where
O1: BitOrder,
O2: BitOrder,
A: BitViewSized,
T: BitStore,
impl<O1, O2, T1, T2> PartialEq<BitBox<T2, O2>> for &BitSlice<T1, O1>where
O1: BitOrder,
O2: BitOrder,
T1: BitStore,
T2: BitStore,
impl<O1, O2, T1, T2> PartialEq<BitBox<T2, O2>> for &mut BitSlice<T1, O1>where
O1: BitOrder,
O2: BitOrder,
T1: BitStore,
T2: BitStore,
impl<O1, O2, T1, T2> PartialEq<BitBox<T2, O2>> for BitSlice<T1, O1>where
O1: BitOrder,
O2: BitOrder,
T1: BitStore,
T2: BitStore,
impl<Ptr, Q> PartialEq<Pin<Q>> for Pin<Ptr>
impl<R> PartialEq for BitEnd<R>where
R: PartialEq + BitRegister,
impl<R> PartialEq for BitIdx<R>where
R: PartialEq + BitRegister,
impl<R> PartialEq for BitIdxError<R>where
R: PartialEq + BitRegister,
impl<R> PartialEq for BitMask<R>where
R: PartialEq + BitRegister,
impl<R> PartialEq for BitPos<R>where
R: PartialEq + BitRegister,
impl<R> PartialEq for BitSel<R>where
R: PartialEq + BitRegister,
impl<T1, T2, O1, O2> PartialEq<&BitSlice<T2, O2>> for BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T1, T2, O1, O2> PartialEq<&mut BitSlice<T2, O2>> for BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T1, T2, O1, O2> PartialEq<BitSlice<T2, O2>> for &BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T1, T2, O1, O2> PartialEq<BitSlice<T2, O2>> for &mut BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T1, T2, O1, O2> PartialEq<BitSlice<T2, O2>> for BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
Tests if two BitSlice
s are semantically — not representationally — equal.
It is valid to compare slices of different ordering or memory types.
The equality condition requires that they have the same length and that at each index, the two slices have the same bit value.
impl<T1, T2, O1, O2> PartialEq<BitVec<T2, O2>> for &BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T1, T2, O1, O2> PartialEq<BitVec<T2, O2>> for &mut BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T1, T2, O1, O2> PartialEq<BitVec<T2, O2>> for BitSlice<T1, O1>where
T1: BitStore,
T2: BitStore,
O1: BitOrder,
O2: BitOrder,
impl<T> PartialEq for Option<T>where
T: PartialEq,
impl<T> PartialEq for std::sync::mpsc::TrySendError<T>where
T: PartialEq,
impl<T> PartialEq for Bound<T>where
T: PartialEq,
impl<T> PartialEq for Poll<T>where
T: PartialEq,
impl<T> PartialEq for *const Twhere
T: ?Sized,
impl<T> PartialEq for *mut Twhere
T: ?Sized,
impl<T> PartialEq for (T₁, T₂, …, Tₙ)
This trait is implemented for tuples up to twelve items long.