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 CachePreferenceError
impl PartialEq for ClientCachePreference
impl PartialEq for CompressPreference
impl PartialEq for PreferredCompression
impl PartialEq for ServerCachePreference
impl PartialEq for UriKey
impl PartialEq for Value
impl PartialEq for BindIpVersion
impl PartialEq for CacheAction
impl PartialEq for Action
impl PartialEq for kvarn::prelude::IpAddr
impl PartialEq for SocketAddr
impl PartialEq for CacheControlError
impl PartialEq for RequestParseStage
impl PartialEq for SanitizeError
impl PartialEq for kvarn::prelude::utils::prelude::fmt::Alignment
impl PartialEq for kvarn::prelude::utils::prelude::io::ErrorKind
impl PartialEq for SeekFrom
impl PartialEq for Ipv6MulticastScope
impl PartialEq for Shutdown
impl PartialEq for ToCompactStringError
impl PartialEq for AsciiChar
impl PartialEq for Infallible
impl PartialEq for FpCategory
impl PartialEq for IntErrorKind
impl PartialEq for SearchStep
impl PartialEq for kvarn::prelude::utils::prelude::compact_str::core::sync::atomic::Ordering
impl PartialEq for kvarn::prelude::utils::prelude::compact_str::core::cmp::Ordering
impl PartialEq for TryReserveErrorKind
impl PartialEq for BacktraceStatus
impl PartialEq for VarError
impl PartialEq for BacktraceStyle
impl PartialEq for std::sync::mpsc::RecvTimeoutError
impl PartialEq for std::sync::mpsc::TryRecvError
impl PartialEq for _Unwind_Action
impl PartialEq for _Unwind_Reason_Code
impl PartialEq for FlushCompress
impl PartialEq for FlushDecompress
impl PartialEq for Status
impl PartialEq for log::Level
impl PartialEq for log::LevelFilter
impl PartialEq for petgraph::dot::Config
impl PartialEq for Direction
impl PartialEq for Variant
impl PartialEq for uuid::Version
impl PartialEq for BernoulliError
impl PartialEq for WeightedError
impl PartialEq for IndexVec
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 PathQuery
impl PartialEq for kvarn::extensions::Id
impl PartialEq for OffsetDateTime
impl PartialEq for Mime
impl PartialEq for Bytes
impl PartialEq for BytesMut
impl PartialEq for kvarn::prelude::Duration
impl PartialEq for HeaderName
impl PartialEq for HeaderValue
impl PartialEq for kvarn::prelude::Instant
impl PartialEq for Method
impl PartialEq for Path
impl PartialEq for PathBuf
impl PartialEq for StatusCode
impl PartialEq for Uri
impl PartialEq for kvarn::prelude::Version
impl PartialEq for CriticalRequestComponents
impl PartialEq for kvarn::prelude::utils::prelude::fmt::Error
impl PartialEq for kvarn::prelude::utils::prelude::net::AddrParseError
impl PartialEq for kvarn::prelude::utils::prelude::net::Ipv4Addr
impl PartialEq for kvarn::prelude::utils::prelude::net::Ipv6Addr
impl PartialEq for SocketAddrV4
impl PartialEq for SocketAddrV6
impl PartialEq for ParseBoolError
impl PartialEq for Utf8Error
impl PartialEq for Authority
impl PartialEq for PathAndQuery
impl PartialEq for Scheme
impl PartialEq for ReserveError
impl PartialEq for AllocError
impl PartialEq for Layout
impl PartialEq for LayoutError
impl PartialEq for TypeId
impl PartialEq for CpuidResult
impl PartialEq for CharTryFromError
impl PartialEq for DecodeUtf16Error
impl PartialEq for ParseCharError
impl PartialEq for TryFromCharError
impl PartialEq for CStr
impl PartialEq for FromBytesUntilNulError
impl PartialEq for FromBytesWithNulError
impl PartialEq for PhantomPinned
impl PartialEq for Assume
impl PartialEq for ParseFloatError
impl PartialEq for kvarn::prelude::utils::prelude::compact_str::core::num::ParseIntError
impl PartialEq for kvarn::prelude::utils::prelude::compact_str::core::num::TryFromIntError
impl PartialEq for RangeFull
impl PartialEq for kvarn::prelude::utils::prelude::compact_str::core::ptr::Alignment
impl PartialEq for RawWaker
impl PartialEq for RawWakerVTable
impl PartialEq for TryFromFloatSecsError
impl PartialEq for EndOfInput
impl PartialEq for UnorderedKeyError
impl PartialEq for alloc::collections::TryReserveError
impl PartialEq for CString
impl PartialEq for FromVecWithNulError
impl PartialEq for IntoStringError
impl PartialEq for NulError
impl PartialEq for FromUtf8Error
impl PartialEq for String
impl PartialEq for OsStr
impl PartialEq for OsString
impl PartialEq for FileType
impl PartialEq for Permissions
impl PartialEq for std::os::unix::net::ucred::UCred
impl PartialEq for StripPrefixError
impl PartialEq for ExitStatus
impl PartialEq for ExitStatusError
impl PartialEq for Output
impl PartialEq for std::sync::condvar::WaitTimeoutResult
impl PartialEq for std::sync::mpsc::RecvError
impl PartialEq for AccessError
impl PartialEq for ThreadId
impl PartialEq for SystemTime
impl PartialEq for FixedBitSet
impl PartialEq for GzHeader
impl PartialEq for Compression
impl PartialEq for getrandom::error::Error
impl PartialEq for ParseLevelError
impl PartialEq for NegativeCycle
impl PartialEq for petgraph::visit::dfsvisit::Time
impl PartialEq for socket2::Domain
impl PartialEq for socket2::Protocol
impl PartialEq for socket2::RecvFlags
impl PartialEq for socket2::Type
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 uuid::error::Error
impl PartialEq for Braced
impl PartialEq for Hyphenated
impl PartialEq for Simple
impl PartialEq for Urn
impl PartialEq for Uuid
impl PartialEq for Timestamp
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 ACCESS_DESCRIPTION_st
impl PartialEq for ASN1_ADB_TABLE_st
impl PartialEq for ASN1_ADB_st
impl PartialEq for ASN1_AUX_st
impl PartialEq for ASN1_EXTERN_FUNCS_st
impl PartialEq for ASN1_ITEM_st
impl PartialEq for ASN1_TEMPLATE_st
impl PartialEq for AUTHORITY_KEYID_st
impl PartialEq for Aborted
impl PartialEq for AccessKind
impl PartialEq for AccessMode
impl PartialEq for AddrParseError
impl PartialEq for AlertDescription
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for Algorithm
impl PartialEq for AlgorithmId
impl PartialEq for AlgorithmId
impl PartialEq for AlgorithmIdentifier
impl PartialEq for Alphabet
impl PartialEq for AnyDelimiterCodec
impl PartialEq for ApplicationClose
impl PartialEq for BASIC_CONSTRAINTS_st
impl PartialEq for BigEndian
impl PartialEq for BlockCipherId
impl PartialEq for BroCatliResult
impl PartialEq for BrotliEncoderMode
impl PartialEq for BrotliEncoderOperation
impl PartialEq for BrotliEncoderParameter
impl PartialEq for BrotliEncoderStreamState
impl PartialEq for BrotliHasherParams
impl PartialEq for BytesCodec
impl PartialEq for CParameter
impl PartialEq for CRYPTO_dynlock
impl PartialEq for CRYPTO_dynlock_value
impl PartialEq for Canceled
impl PartialEq for CapacityError
impl PartialEq for CertRevocationListError
impl PartialEq for CertificateError
impl PartialEq for Chunk
impl PartialEq for CipherSuite
impl PartialEq for CloseCode
impl PartialEq for ClosedStream
impl PartialEq for Code
impl PartialEq for Code
impl PartialEq for CodeBlockState
impl PartialEq for Collector
impl PartialEq for CompareResult
impl PartialEq for Component
impl PartialEq for ComponentRange
impl PartialEq for CompressionLevel
impl PartialEq for CompressionStrategy
impl PartialEq for Config
impl PartialEq for ConfigError
impl PartialEq for ConnectError
impl PartialEq for ConnectionClose
impl PartialEq for ConnectionError
impl PartialEq for ConnectionHandle
impl PartialEq for ConnectionId
impl PartialEq for ContentType
impl PartialEq for Control
impl PartialEq for ConversionRange
impl PartialEq for CreateKind
impl PartialEq for DES_cblock_st
impl PartialEq for DES_ks
impl PartialEq for DIST_POINT_st
impl PartialEq for DParameter
impl PartialEq for DSA_SIG_st
impl PartialEq for Data
impl PartialEq for DataChange
impl PartialEq for DataFormat
impl PartialEq for Date
impl PartialEq for DateKind
impl PartialEq for Day
impl PartialEq for DecodeError
impl PartialEq for DecodeMetadata
impl PartialEq for DecodePaddingMode
impl PartialEq for DecodeSliceError
impl PartialEq for DerTypeId
impl PartialEq for DifferentVariant
impl PartialEq for Dir
impl PartialEq for Domain
impl PartialEq for Duration
impl PartialEq for EC_builtin_curve
impl PartialEq for EDIPartyName_st
impl PartialEq for EcdsaSigningAlgorithm
impl PartialEq for EcdsaSigningAlgorithm
impl PartialEq for EcdsaVerificationAlgorithm
impl PartialEq for EcnCodepoint
impl PartialEq for EcnCodepoint
impl PartialEq for Elapsed
impl PartialEq for Empty
impl PartialEq for EncodeSliceError
impl PartialEq for EncryptionAlgorithmId
impl PartialEq for End
impl PartialEq for Endianness
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 ErrorKind
impl PartialEq for ErrorLevel
impl PartialEq for Event
impl PartialEq for EventKind
impl PartialEq for EventMask
impl PartialEq for ExpirationPolicy
impl PartialEq for ExportKeyingMaterialError
impl PartialEq for Field
impl PartialEq for FieldSet
impl PartialEq for FileTime
impl PartialEq for FilterOp
impl PartialEq for FinishError
impl PartialEq for Flag
impl PartialEq for Flags
impl PartialEq for FormattedComponents
impl PartialEq for Frame
impl PartialEq for FrameHeader
impl PartialEq for FsyncFlags
impl PartialEq for GENERAL_SUBTREE_st
impl PartialEq for H5Sub
impl PartialEq for H6Sub
impl PartialEq for H9Opts
impl PartialEq for HQ5Sub
impl PartialEq for HQ7Sub
impl PartialEq for HRSS_private_key
impl PartialEq for HRSS_public_key
impl PartialEq for Handle
impl PartialEq for HandshakeKind
impl PartialEq for HandshakeType
impl PartialEq for HashAlgorithm
impl PartialEq for Hour
impl PartialEq for HuffmanCode
impl PartialEq for ISSUING_DIST_POINT_st
impl PartialEq for Id
impl PartialEq for Identifier
impl PartialEq for IdleTimeout
impl PartialEq for Ignore
impl PartialEq for IndeterminateOffset
impl PartialEq for Instant
impl PartialEq for Instant
impl PartialEq for Interest
impl PartialEq for Interest
impl PartialEq for InvalidBufferSize
impl PartialEq for InvalidFormatDescription
impl PartialEq for InvalidLength
impl PartialEq for InvalidMessage
impl PartialEq for InvalidStreamId
impl PartialEq for InvalidVariant
impl PartialEq for IoState
impl PartialEq for IpAddr
impl PartialEq for Ipv4Addr
impl PartialEq for Ipv6Addr
impl PartialEq for Item
impl PartialEq for KeyExchangeAlgorithm
impl PartialEq for KeyRejected
impl PartialEq for KeySize
impl PartialEq for Kind
impl PartialEq for Level
impl PartialEq for LevelFilter
impl PartialEq for LinesCodec
impl PartialEq for LiteralPredictionModeNibble
impl PartialEq for LittleEndian
impl PartialEq for LongType
impl PartialEq for MZError
impl PartialEq for MZFlush
impl PartialEq for MZStatus
impl PartialEq for Message
impl PartialEq for MetadataKind
impl PartialEq for MimeGuess
impl PartialEq for Minute
impl PartialEq for MissedTickBehavior
impl PartialEq for ModifyKind
impl PartialEq for Month
impl PartialEq for Month
impl PartialEq for MonthRepr
impl PartialEq for NAME_CONSTRAINTS_st
impl PartialEq for NOTICEREF_st
impl PartialEq for NamedGroup
impl PartialEq for Needed
impl PartialEq for Netscape_spkac_st
impl PartialEq for Netscape_spki_st
impl PartialEq for Null
impl PartialEq for OffsetHour
impl PartialEq for OffsetMinute
impl PartialEq for OffsetPrecision
impl PartialEq for OffsetSecond
impl PartialEq for OnceState
impl PartialEq for OpCode
impl PartialEq for OperatingMode
impl PartialEq for Ordinal
impl PartialEq for OtherError
impl PartialEq for OwnedFormatItem
impl PartialEq for PKCS7_SIGNED
impl PartialEq for PKCS7_SIGN_ENVELOPE
impl PartialEq for POLICYINFO_st
impl PartialEq for POLICY_CONSTRAINTS_st
impl PartialEq for POLICY_MAPPING_st
impl PartialEq for PacketDecodeError
impl PartialEq for Padding
impl PartialEq for ParkResult
impl PartialEq for ParkToken
impl PartialEq for Parse
impl PartialEq for ParseAlphabetError
impl PartialEq for ParseFromDescription
impl PartialEq for ParseIntError
impl PartialEq for PeerIncompatible
impl PartialEq for PeerMisbehaved
impl PartialEq for Period
impl PartialEq for PollNext
impl PartialEq for PrimitiveDateTime
impl PartialEq for Protocol
impl PartialEq for Protocol
impl PartialEq for Protocol
impl PartialEq for ProtocolError
impl PartialEq for ProtocolVersion
impl PartialEq for PushError
impl PartialEq for RIPEMD160state_st
impl PartialEq for ReadError
impl PartialEq for ReadError
impl PartialEq for ReadExactError
impl PartialEq for ReadToEndError
impl PartialEq for ReadableError
impl PartialEq for Ready
impl PartialEq for ReadyTimeoutError
impl PartialEq for Reason
impl PartialEq for RecursiveMode
impl PartialEq for RecvError
impl PartialEq for RecvError
impl PartialEq for RecvError
impl PartialEq for RecvFlags
impl PartialEq for RecvTimeoutError
impl PartialEq for RemovalCause
impl PartialEq for RemoveKind
impl PartialEq for RenameMode
impl PartialEq for RequeueOp
impl PartialEq for RevocationCheckDepth
impl PartialEq for RevocationReason
impl PartialEq for Rfc2822
impl PartialEq for Rfc3339
impl PartialEq for Rng
impl PartialEq for Role
impl PartialEq for RuntimeFlavor
impl PartialEq for Second
impl PartialEq for SelectTimeoutError
impl PartialEq for SendDatagramError
impl PartialEq for SendDatagramError
impl PartialEq for SendError
impl PartialEq for Side
impl PartialEq for Side
impl PartialEq for SignatureAlgorithm
impl PartialEq for SignatureScheme
impl PartialEq for SockAddr
impl PartialEq for Soundness
impl PartialEq for Span
impl PartialEq for StoppedError
impl PartialEq for StreamEvent
impl PartialEq for StreamId
impl PartialEq for StreamId
impl PartialEq for StreamId
impl PartialEq for StreamResult
impl PartialEq for Struct1
impl PartialEq for SubProtocolError
impl PartialEq for Subsecond
impl PartialEq for SubsecondDigits
impl PartialEq for SupportedCipherSuite
impl PartialEq for SupportedProtocolVersion
impl PartialEq for TDEFLFlush
impl PartialEq for TDEFLStatus
impl PartialEq for TINFLStatus
impl PartialEq for TagPropagation
impl PartialEq for Time
impl PartialEq for TimePrecision
impl PartialEq for TimeoutFlags
impl PartialEq for Tls12CipherSuite
impl PartialEq for Tls12Resumption
impl PartialEq for Tls13CipherSuite
impl PartialEq for TlsProtocolId
impl PartialEq for Token
impl PartialEq for TransportParameters
impl PartialEq for TryAcquireError
impl PartialEq for TryFromIntError
impl PartialEq for TryFromParsed
impl PartialEq for TryReadyError
impl PartialEq for TryRecvError
impl PartialEq for TryRecvError
impl PartialEq for TryRecvError
impl PartialEq for TryRecvError
impl PartialEq for TryReserveError
impl PartialEq for TryReserveError
impl PartialEq for TryReserveError
impl PartialEq for TrySelectError
impl PartialEq for Type
impl PartialEq for UCred
impl PartialEq for USERNOTICE_st
impl PartialEq for UnixTime
impl PartialEq for UnixTimestamp
impl PartialEq for UnixTimestampPrecision
impl PartialEq for UnknownStatusPolicy
impl PartialEq for UnparkResult
impl PartialEq for UnparkToken
impl PartialEq for Unspecified
impl PartialEq for Unspecified
impl PartialEq for UnsupportedOperationError
impl PartialEq for UrlError
impl PartialEq for UtcOffset
impl PartialEq for VarInt
impl PartialEq for VarIntBoundsExceeded
impl PartialEq for VerboseErrorKind
impl PartialEq for WaitTimeoutResult
impl PartialEq for WatchDescriptor
impl PartialEq for WatchMask
impl PartialEq for WatcherKind
impl PartialEq for WeekNumber
impl PartialEq for WeekNumberRepr
impl PartialEq for Weekday
impl PartialEq for Weekday
impl PartialEq for WeekdayRepr
impl PartialEq for WriteError
impl PartialEq for WriteError
impl PartialEq for Written
impl PartialEq for X509_algor_st
impl PartialEq for X509_info_st
impl PartialEq for Year
impl PartialEq for YearRepr
impl PartialEq for ZSTD_EndDirective
impl PartialEq for ZSTD_ResetDirective
impl PartialEq for ZSTD_cParameter
impl PartialEq for ZSTD_dParameter
impl PartialEq for ZSTD_strategy
impl PartialEq for _IO_FILE
impl PartialEq for __va_list_tag
impl PartialEq for aes_key_st
impl PartialEq for asn1_string_st
impl PartialEq for bf_key_st
impl PartialEq for bignum_st
impl PartialEq for bio_method_st
impl PartialEq for bio_st
impl PartialEq for blake2b_state_st
impl PartialEq for bn_mont_ctx_st
impl PartialEq for buf_mem_st
impl PartialEq for cbb_buffer_st
impl PartialEq for cbb_child_st
impl PartialEq for cbs_st
impl PartialEq for conf_value_st
impl PartialEq for crypto_ex_data_st
impl PartialEq for ecdsa_method_st
impl PartialEq for ecdsa_sig_st
impl PartialEq for env_md_ctx_st
impl PartialEq for evp_cipher_ctx_st
impl PartialEq for evp_cipher_info_st
impl PartialEq for evp_encode_ctx_st
impl PartialEq for evp_hpke_key_st
impl PartialEq for md4_state_st
impl PartialEq for md5_state_st
impl PartialEq for obj_name_st
impl PartialEq for openssl_method_common_st
impl PartialEq for otherName_st
impl PartialEq for point_conversion_form_t
impl PartialEq for private_key_st
impl PartialEq for rand_meth_st
impl PartialEq for rc4_key_st
impl PartialEq for rsa_meth_st
impl PartialEq for rsa_pss_params_st
impl PartialEq for sha256_state_st
impl PartialEq for sha512_state_st
impl PartialEq for sha_state_st
impl PartialEq for tm
impl PartialEq for trust_token_st
impl PartialEq for v3_ext_ctx
impl PartialEq for v3_ext_method
impl PartialEq for vec128_storage
impl PartialEq for vec256_storage
impl PartialEq for vec512_storage
impl PartialEq for x509_purpose_st
impl PartialEq for x509_trust_st
impl PartialEq<&str> for OsString
impl PartialEq<&[BorrowedFormatItem<'_>]> for BorrowedFormatItem<'_>
impl PartialEq<&[OwnedFormatItem]> for OwnedFormatItem
impl PartialEq<IpAddr> for kvarn::prelude::utils::prelude::net::Ipv4Addr
impl PartialEq<IpAddr> for kvarn::prelude::utils::prelude::net::Ipv6Addr
impl PartialEq<Level> for log::LevelFilter
impl PartialEq<LevelFilter> for log::Level
impl PartialEq<str> for Bytes
impl PartialEq<str> for BytesMut
impl PartialEq<str> for HeaderName
impl PartialEq<str> for HeaderValue
impl PartialEq<str> for Method
impl PartialEq<str> for Uri
impl PartialEq<str> for ValueQualitySet<'_>
impl PartialEq<str> for Authority
Case-insensitive equality
§Examples
let authority: Authority = "HELLO.com".parse().unwrap();
assert_eq!(authority, "hello.coM");
assert_eq!("hello.com", authority);
impl PartialEq<str> for PathAndQuery
impl PartialEq<str> for Scheme
Case-insensitive equality
§Examples
let scheme: Scheme = "HTTP".parse().unwrap();
assert_eq!(scheme, *"http");
impl PartialEq<str> for OsStr
impl PartialEq<str> for OsString
impl PartialEq<u16> for StatusCode
impl PartialEq<u64> for Code
impl PartialEq<OffsetDateTime> for SystemTime
std
only.impl PartialEq<Bytes> for &str
impl PartialEq<Bytes> for &[u8]
impl PartialEq<Bytes> for str
impl PartialEq<Bytes> for BytesMut
impl PartialEq<Bytes> for String
impl PartialEq<Bytes> for Vec<u8>
impl PartialEq<Bytes> for [u8]
impl PartialEq<BytesMut> for &str
impl PartialEq<BytesMut> for &[u8]
impl PartialEq<BytesMut> for str
impl PartialEq<BytesMut> for Bytes
impl PartialEq<BytesMut> for String
impl PartialEq<BytesMut> for Vec<u8>
impl PartialEq<BytesMut> for [u8]
impl PartialEq<CompactString> for &&str
impl PartialEq<CompactString> for &str
impl PartialEq<CompactString> for &CompactString
impl PartialEq<CompactString> for &String
impl PartialEq<CompactString> for str
impl PartialEq<CompactString> for String
impl PartialEq<Duration> for Duration
impl PartialEq<HeaderName> for str
impl PartialEq<HeaderValue> for str
impl PartialEq<HeaderValue> for String
impl PartialEq<HeaderValue> for [u8]
impl PartialEq<Instant> for Instant
impl PartialEq<Method> for str
impl PartialEq<Path> for PathBuf
impl PartialEq<Path> for OsStr
impl PartialEq<Path> for OsString
impl PartialEq<PathBuf> for Path
impl PartialEq<PathBuf> for OsStr
impl PartialEq<PathBuf> for OsString
impl PartialEq<StatusCode> for u16
impl PartialEq<Uri> for str
impl PartialEq<Ipv4Addr> for kvarn::prelude::IpAddr
impl PartialEq<Ipv6Addr> for kvarn::prelude::IpAddr
impl PartialEq<Authority> for str
impl PartialEq<Authority> for String
impl PartialEq<PathAndQuery> for str
impl PartialEq<PathAndQuery> for String
impl PartialEq<Scheme> for str
Case-insensitive equality
impl PartialEq<String> for &CompactString
impl PartialEq<String> for Bytes
impl PartialEq<String> for BytesMut
impl PartialEq<String> for HeaderValue
impl PartialEq<String> for Authority
impl PartialEq<String> for PathAndQuery
impl PartialEq<Vec<u8>> for Bytes
impl PartialEq<Vec<u8>> for BytesMut
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<SystemTime> for OffsetDateTime
std
only.impl PartialEq<BorrowedFormatItem<'_>> for &[BorrowedFormatItem<'_>]
impl PartialEq<BorrowedFormatItem<'_>> for Component
impl PartialEq<Component> for BorrowedFormatItem<'_>
impl PartialEq<Component> for OwnedFormatItem
impl PartialEq<Duration> for kvarn::prelude::Duration
impl PartialEq<Instant> for kvarn::prelude::Instant
impl PartialEq<Level> for LevelFilter
impl PartialEq<LevelFilter> for Level
impl PartialEq<OwnedFormatItem> for &[OwnedFormatItem]
impl PartialEq<OwnedFormatItem> for Component
impl PartialEq<[u8]> for Bytes
impl PartialEq<[u8]> for BytesMut
impl PartialEq<[u8]> for HeaderValue
impl<'a> PartialEq for std::path::Component<'a>
impl<'a> PartialEq for Prefix<'a>
impl<'a> PartialEq for CertificateDer<'a>
impl<'a> PartialEq for Query<'a>
impl<'a> PartialEq for QueryPair<'a>
impl<'a> PartialEq for ValueQualitySet<'a>
impl<'a> PartialEq for Utf8Chunk<'a>
impl<'a> PartialEq for Location<'a>
impl<'a> PartialEq for Components<'a>
impl<'a> PartialEq for PrefixComponent<'a>
impl<'a> PartialEq for log::Metadata<'a>
impl<'a> PartialEq for MetadataBuilder<'a>
impl<'a> PartialEq for Name<'a>
impl<'a> PartialEq for BorrowedFormatItem<'a>
impl<'a> PartialEq for CertificateRevocationListDer<'a>
impl<'a> PartialEq for CertificateSigningRequestDer<'a>
impl<'a> PartialEq for Der<'a>
impl<'a> PartialEq for DnsName<'a>
impl<'a> PartialEq for EchConfigListBytes<'a>
impl<'a> PartialEq for FfdheGroup<'a>
impl<'a> PartialEq for InputPair<'a>
impl<'a> PartialEq for Metadata<'a>
impl<'a> PartialEq for PrivateKeyDer<'a>
impl<'a> PartialEq for PrivatePkcs1KeyDer<'a>
impl<'a> PartialEq for PrivatePkcs8KeyDer<'a>
impl<'a> PartialEq for PrivateSec1KeyDer<'a>
impl<'a> PartialEq for ServerName<'a>
impl<'a> PartialEq for SubjectPublicKeyInfoDer<'a>
impl<'a> PartialEq for TrustAnchor<'a>
impl<'a> PartialEq<&'a str> for Mime
impl<'a> PartialEq<&'a str> for HeaderName
impl<'a> PartialEq<&'a str> for Method
impl<'a> PartialEq<&'a str> for Uri
impl<'a> PartialEq<&'a str> for Authority
impl<'a> PartialEq<&'a str> for PathAndQuery
impl<'a> PartialEq<&'a CompactString> for str
impl<'a> PartialEq<&'a CompactString> for String
impl<'a> PartialEq<&'a HeaderName> for HeaderName
impl<'a> PartialEq<&'a Method> for Method
impl<'a> PartialEq<&'a Path> for PathBuf
impl<'a> PartialEq<&'a Path> for OsStr
impl<'a> PartialEq<&'a Path> for OsString
impl<'a> PartialEq<&'a OsStr> for Path
impl<'a> PartialEq<&'a OsStr> for PathBuf
impl<'a> PartialEq<Cow<'a, str>> for &CompactString
impl<'a> PartialEq<Cow<'a, Path>> for Path
impl<'a> PartialEq<Cow<'a, Path>> for PathBuf
impl<'a> PartialEq<Cow<'a, Path>> for OsStr
impl<'a> PartialEq<Cow<'a, Path>> for OsString
impl<'a> PartialEq<Cow<'a, OsStr>> for Path
impl<'a> PartialEq<Cow<'a, OsStr>> for PathBuf
impl<'a> PartialEq<Mime> for &'a str
impl<'a> PartialEq<CompactString> for &Cow<'a, str>
impl<'a> PartialEq<CompactString> for Cow<'a, str>
impl<'a> PartialEq<HeaderName> for &'a str
impl<'a> PartialEq<HeaderName> for &'a HeaderName
impl<'a> PartialEq<HeaderValue> for &'a str
impl<'a> PartialEq<HeaderValue> for &'a HeaderValue
impl<'a> PartialEq<Method> for &'a str
impl<'a> PartialEq<Method> for &'a Method
impl<'a> PartialEq<Path> for &'a OsStr
impl<'a> PartialEq<Path> for Cow<'a, Path>
impl<'a> PartialEq<Path> for Cow<'a, OsStr>
impl<'a> PartialEq<PathBuf> for &'a Path
impl<'a> PartialEq<PathBuf> for &'a OsStr
impl<'a> PartialEq<PathBuf> for Cow<'a, Path>
impl<'a> PartialEq<PathBuf> for Cow<'a, OsStr>
impl<'a> PartialEq<Uri> for &'a str
impl<'a> PartialEq<Authority> for &'a str
impl<'a> PartialEq<PathAndQuery> for &'a str
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, 'b> PartialEq<&'a str> for String
impl<'a, 'b> PartialEq<&'a Path> for Cow<'b, OsStr>
impl<'a, 'b> PartialEq<&'a OsStr> for OsString
impl<'a, 'b> PartialEq<&'b str> for Cow<'a, str>
impl<'a, 'b> PartialEq<&'b str> for Name<'a>
impl<'a, 'b> PartialEq<&'b Path> for Cow<'a, Path>
impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, Path>
impl<'a, 'b> PartialEq<&'b OsStr> for Cow<'a, OsStr>
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, Path>> for &'b Path
impl<'a, 'b> PartialEq<Cow<'a, Path>> for &'b OsStr
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<'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<String> for &'a str
impl<'a, 'b> PartialEq<String> for Cow<'a, str>
impl<'a, 'b> PartialEq<String> for str
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<Name<'a>> for &'b str
impl<'a, 'b, B, C> PartialEq<Cow<'b, C>> for Cow<'a, B>
impl<'a, E, Ix> PartialEq for petgraph::adj::EdgeReference<'a, E, Ix>
impl<'a, E, Ix> PartialEq for petgraph::graph_impl::stable_graph::EdgeReference<'a, E, Ix>
impl<'a, E, Ix> PartialEq for petgraph::graph_impl::EdgeReference<'a, E, Ix>
impl<'a, S1> PartialEq<Ascii<S1>> for &'a str
impl<'a, T> PartialEq for GetAll<'a, T>where
T: PartialEq,
impl<'a, T> PartialEq for ArcBorrow<'a, T>
impl<'a, T> PartialEq<&'a T> for Bytes
impl<'a, T> PartialEq<&'a T> for BytesMut
impl<'a, T> PartialEq<&'a T> for HeaderValue
impl<'b, T> PartialEq for Ptr<'b, T>
impl<'s, T> PartialEq for SliceVec<'s, T>where
T: PartialEq,
impl<'s, T> PartialEq<&[T]> for SliceVec<'s, T>where
T: PartialEq,
impl<'t> PartialEq for CloseFrame<'t>
impl<A> PartialEq for Aad<A>where
A: PartialEq,
impl<A> PartialEq for ArrayVec<A>where
A: Array,
<A as Array>::Item: PartialEq,
impl<A> PartialEq for BasicHasher<A>
impl<A> PartialEq for TinyVec<A>where
A: Array,
<A as Array>::Item: PartialEq,
impl<A> PartialEq<&[<A as Array>::Item]> for ArrayVec<A>where
A: Array,
<A as Array>::Item: PartialEq,
impl<A> PartialEq<&[<A as Array>::Item]> for TinyVec<A>where
A: Array,
<A as Array>::Item: PartialEq,
impl<A> PartialEq<&A> for ArrayVec<A>where
A: Array,
<A as Array>::Item: PartialEq,
impl<A> PartialEq<&A> for TinyVec<A>where
A: Array,
<A as Array>::Item: PartialEq,
impl<A, B> PartialEq for ArcUnion<A, B>
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, B> PartialEq<SmallVec<B>> for SmallVec<A>where
A: Array,
B: Array,
<A as Array>::Item: PartialEq<<B as Array>::Item>,
impl<Alloc> PartialEq for H9<Alloc>
impl<Alloc> PartialEq for UnionHasher<Alloc>
impl<AllocU32> PartialEq for H10Buckets<AllocU32>where
AllocU32: Allocator<u32>,
impl<AllocU32, Buckets, Params> PartialEq for H10<AllocU32, Buckets, Params>
impl<B, C> PartialEq for ControlFlow<B, C>
impl<Dyn> PartialEq for DynMetadata<Dyn>where
Dyn: ?Sized,
impl<E> PartialEq for Err<E>where
E: PartialEq,
impl<F> PartialEq for Fwhere
F: FnPtr,
impl<H> PartialEq for BuildHasherDefault<H>
impl<H> PartialEq for HeaderWithLength<H>where
H: PartialEq,
impl<H, T> PartialEq for HeaderSlice<H, T>
impl<H, T> PartialEq for ThinArc<H, T>
impl<I> PartialEq for Error<I>where
I: PartialEq,
impl<I> PartialEq for VerboseError<I>where
I: PartialEq,
impl<Id> PartialEq for Algorithm<Id>where
Id: PartialEq + AlgorithmIdentifier,
impl<Idx> PartialEq for Range<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for RangeFrom<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for RangeInclusive<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for RangeTo<Idx>where
Idx: PartialEq,
impl<Idx> PartialEq for RangeToInclusive<Idx>where
Idx: PartialEq,
impl<Ix> PartialEq for petgraph::adj::EdgeIndex<Ix>
impl<Ix> PartialEq for petgraph::graph_impl::EdgeIndex<Ix>where
Ix: PartialEq,
impl<Ix> PartialEq for NodeIndex<Ix>where
Ix: PartialEq,
impl<K, V1, S1, V2, S2> PartialEq<IndexMap<K, V2, S2>> for IndexMap<K, V1, S1>
impl<K, V> PartialEq for Slice<K, V>
impl<K, V, A> PartialEq for BTreeMap<K, V, A>
impl<K, V, S> PartialEq for kvarn::prelude::HashMap<K, V, S>
impl<K, V, S, A> PartialEq for HashMap<K, V, S, A>
impl<N> PartialEq for Cycle<N>where
N: PartialEq,
impl<N, E> PartialEq for Element<N, E>
impl<Ptr, Q> PartialEq<Pin<Q>> for Pin<Ptr>
impl<S1> PartialEq<Ascii<S1>> for String
impl<S1, S2> PartialEq<UniCase<S2>> for UniCase<S1>
impl<S1, S2> PartialEq<S2> for Ascii<S1>
impl<Specialization, Alloc> PartialEq for AdvHasher<Specialization, Alloc>
impl<Storage> PartialEq for __BindgenBitfieldUnit<Storage>where
Storage: PartialEq,
impl<T> PartialEq for Poll<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 std::sync::mpsc::TrySendError<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.