Trait std::marker::StructuralPartialEq
pub trait StructuralPartialEq { }
Required trait for constants used in pattern matches.
Any type that derives PartialEq
automatically implements this trait, regardless of whether its type-parameters implement Eq
.
If a const
item contains some type that does not implement this trait, then that type either (1.) does not implement PartialEq
(which means the constant will not provide that comparison method, which code generation assumes is available), or (2.) it implements its own version of PartialEq
(which we assume does not conform to a structural-equality comparison).
In either of the two scenarios above, we reject usage of such a constant in a pattern match.
See also the structural match RFC, and issue 63438 which motivated migrating from attribute-based design to this trait.
Implementations on Foreign Types
impl StructuralPartialEq for FromSecsError
impl<'a> StructuralPartialEq for Utf8LossyChunk<'a>
impl StructuralPartialEq for CpuidResult
Implementors
impl StructuralPartialEq for BacktraceStatus
impl StructuralPartialEq for std::cmp::Ordering
impl StructuralPartialEq for TryReserveErrorKind
impl StructuralPartialEq for VarError
impl StructuralPartialEq for ErrorKind
impl StructuralPartialEq for SeekFrom
impl StructuralPartialEq for IpAddr
impl StructuralPartialEq for Ipv6MulticastScope
impl StructuralPartialEq for Shutdown
impl StructuralPartialEq for SocketAddr
impl StructuralPartialEq for FpCategory
impl StructuralPartialEq for IntErrorKind
impl StructuralPartialEq for SearchStep
impl StructuralPartialEq for std::sync::atomic::Ordering
impl StructuralPartialEq for RecvTimeoutError
impl StructuralPartialEq for TryRecvError
impl StructuralPartialEq for AllocError
impl StructuralPartialEq for Layout
impl StructuralPartialEq for LayoutError
impl StructuralPartialEq for TypeId
impl StructuralPartialEq for CharTryFromError
impl StructuralPartialEq for DecodeUtf16Error
impl StructuralPartialEq for ParseCharError
impl StructuralPartialEq for TryReserveError
impl StructuralPartialEq for CString
impl StructuralPartialEq for FromBytesWithNulError
impl StructuralPartialEq for FromVecWithNulError
impl StructuralPartialEq for IntoStringError
impl StructuralPartialEq for NulError
impl StructuralPartialEq for Error
impl StructuralPartialEq for FileType
impl StructuralPartialEq for Permissions
impl StructuralPartialEq for AddrParseError
impl StructuralPartialEq for NonZeroI8
impl StructuralPartialEq for NonZeroI16
impl StructuralPartialEq for NonZeroI32
impl StructuralPartialEq for NonZeroI64
impl StructuralPartialEq for NonZeroI128
impl StructuralPartialEq for NonZeroIsize
impl StructuralPartialEq for NonZeroU8
impl StructuralPartialEq for NonZeroU16
impl StructuralPartialEq for NonZeroU32
impl StructuralPartialEq for NonZeroU64
impl StructuralPartialEq for NonZeroU128
impl StructuralPartialEq for NonZeroUsize
impl StructuralPartialEq for ParseFloatError
impl StructuralPartialEq for ParseIntError
impl StructuralPartialEq for TryFromIntError
impl StructuralPartialEq for RangeFull
impl StructuralPartialEq for StripPrefixError
impl StructuralPartialEq for ExitStatus
impl StructuralPartialEq for ExitStatusError
impl StructuralPartialEq for Output
impl StructuralPartialEq for ParseBoolError
impl StructuralPartialEq for Utf8Error
impl StructuralPartialEq for FromUtf8Error
impl StructuralPartialEq for RecvError
impl StructuralPartialEq for WaitTimeoutResult
impl StructuralPartialEq for RawWaker
impl StructuralPartialEq for RawWakerVTable
impl StructuralPartialEq for AccessError
impl StructuralPartialEq for ThreadId
impl StructuralPartialEq for Duration
impl StructuralPartialEq for Instant
impl StructuralPartialEq for SystemTime
impl StructuralPartialEq for PhantomPinned
impl<'a> StructuralPartialEq for Component<'a>
impl<'a> StructuralPartialEq for Prefix<'a>
impl<'a> StructuralPartialEq for Location<'a>
impl<B, C> StructuralPartialEq for ControlFlow<B, C>
impl<Idx> StructuralPartialEq for Range<Idx>
impl<Idx> StructuralPartialEq for RangeFrom<Idx>
impl<Idx> StructuralPartialEq for RangeInclusive<Idx>
impl<Idx> StructuralPartialEq for RangeTo<Idx>
impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>
impl<T> StructuralPartialEq for Bound<T>
impl<T> StructuralPartialEq for Option<T>
impl<T> StructuralPartialEq for TrySendError<T>
impl<T> StructuralPartialEq for Poll<T>
impl<T> StructuralPartialEq for Reverse<T>
impl<T> StructuralPartialEq for BTreeSet<T>
impl<T> StructuralPartialEq for Cursor<T>
impl<T> StructuralPartialEq for Saturating<T>
impl<T> StructuralPartialEq for Wrapping<T>
impl<T> StructuralPartialEq for SendError<T>
impl<T, E> StructuralPartialEq for Result<T, E>
impl<Y, R> StructuralPartialEq for GeneratorState<Y, R>
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/marker/trait.StructuralPartialEq.html