pub trait StructuralPartialEq { }
structural_match
)Expand description
Required trait for constants used in pattern matches.
Any type that derives PartialEq
automatically implements this trait,
regardless of whether its type-parameters implement PartialEq
.
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 an attribute-based design to this trait.
Implementorsยง
impl StructuralPartialEq for DecodeError
impl StructuralPartialEq for wiwi::prelude_std::atomic::Ordering
impl StructuralPartialEq for wiwi::prelude_std::cmp::Ordering
impl StructuralPartialEq for VarError
impl StructuralPartialEq for wiwi::prelude_std::fmt::Alignment
impl StructuralPartialEq for BacktraceStyle
impl StructuralPartialEq for SearchStep
impl StructuralPartialEq for alloc::collections::TryReserveErrorKind
impl StructuralPartialEq for AsciiChar
impl StructuralPartialEq for IpAddr
impl StructuralPartialEq for Ipv6MulticastScope
impl StructuralPartialEq for SocketAddr
impl StructuralPartialEq for FpCategory
impl StructuralPartialEq for IntErrorKind
impl StructuralPartialEq for BacktraceStatus
impl StructuralPartialEq for SeekFrom
impl StructuralPartialEq for ErrorKind
impl StructuralPartialEq for Shutdown
impl StructuralPartialEq for RecvTimeoutError
impl StructuralPartialEq for std::sync::mpsc::TryRecvError
impl StructuralPartialEq for _Unwind_Action
impl StructuralPartialEq for _Unwind_Reason_Code
impl StructuralPartialEq for Colons
impl StructuralPartialEq for Fixed
impl StructuralPartialEq for Numeric
impl StructuralPartialEq for OffsetPrecision
impl StructuralPartialEq for Pad
impl StructuralPartialEq for ParseErrorKind
impl StructuralPartialEq for SecondsFormat
impl StructuralPartialEq for Month
impl StructuralPartialEq for RoundingError
impl StructuralPartialEq for Weekday
impl StructuralPartialEq for bool
impl StructuralPartialEq for char
impl StructuralPartialEq for i8
impl StructuralPartialEq for i16
impl StructuralPartialEq for i32
impl StructuralPartialEq for i64
impl StructuralPartialEq for i128
impl StructuralPartialEq for isize
impl StructuralPartialEq for str
impl StructuralPartialEq for u8
impl StructuralPartialEq for u16
impl StructuralPartialEq for u32
impl StructuralPartialEq for u64
impl StructuralPartialEq for u128
impl StructuralPartialEq for ()
impl StructuralPartialEq for usize
impl StructuralPartialEq for wiwi::prelude_std::alloc_mod::AllocError
impl StructuralPartialEq for Layout
impl StructuralPartialEq for LayoutError
impl StructuralPartialEq for Error
impl StructuralPartialEq for Assume
impl StructuralPartialEq for RangeFull
impl StructuralPartialEq for wiwi::prelude_std::ptr::Alignment
impl StructuralPartialEq for ParseBoolError
impl StructuralPartialEq for Utf8Error
impl StructuralPartialEq for FromUtf8Error
impl StructuralPartialEq for PhantomPinned
impl StructuralPartialEq for String
impl StructuralPartialEq for UnorderedKeyError
impl StructuralPartialEq for alloc::collections::TryReserveError
impl StructuralPartialEq for CString
impl StructuralPartialEq for FromVecWithNulError
impl StructuralPartialEq for IntoStringError
impl StructuralPartialEq for NulError
impl StructuralPartialEq for CharTryFromError
impl StructuralPartialEq for ParseCharError
impl StructuralPartialEq for DecodeUtf16Error
impl StructuralPartialEq for TryFromCharError
impl StructuralPartialEq for CpuidResult
impl StructuralPartialEq for CStr
impl StructuralPartialEq for FromBytesUntilNulError
impl StructuralPartialEq for FromBytesWithNulError
impl StructuralPartialEq for Ipv4Addr
impl StructuralPartialEq for Ipv6Addr
impl StructuralPartialEq for AddrParseError
impl StructuralPartialEq for SocketAddrV4
impl StructuralPartialEq for SocketAddrV6
impl StructuralPartialEq for ParseFloatError
impl StructuralPartialEq for ParseIntError
impl StructuralPartialEq for TryFromIntError
impl StructuralPartialEq for RawWaker
impl StructuralPartialEq for RawWakerVTable
impl StructuralPartialEq for Duration
impl StructuralPartialEq for TryFromFloatSecsError
impl StructuralPartialEq for FileType
impl StructuralPartialEq for Permissions
impl StructuralPartialEq for std::os::unix::net::ucred::UCred
impl StructuralPartialEq for StripPrefixError
impl StructuralPartialEq for ExitCode
impl StructuralPartialEq for ExitStatus
impl StructuralPartialEq for ExitStatusError
impl StructuralPartialEq for Output
impl StructuralPartialEq for std::sync::condvar::WaitTimeoutResult
impl StructuralPartialEq for std::sync::mpsc::RecvError
impl StructuralPartialEq for AccessError
impl StructuralPartialEq for ThreadId
impl StructuralPartialEq for std::time::Instant
impl StructuralPartialEq for SystemTime
impl StructuralPartialEq for Parsed
impl StructuralPartialEq for InternalFixed
impl StructuralPartialEq for InternalNumeric
impl StructuralPartialEq for OffsetFormat
impl StructuralPartialEq for ParseError
impl StructuralPartialEq for Months
impl StructuralPartialEq for ParseMonthError
impl StructuralPartialEq for NaiveDate
impl StructuralPartialEq for NaiveDateDaysIterator
impl StructuralPartialEq for NaiveDateWeeksIterator
impl StructuralPartialEq for NaiveDateTime
impl StructuralPartialEq for IsoWeek
impl StructuralPartialEq for Days
impl StructuralPartialEq for NaiveTime
impl StructuralPartialEq for FixedOffset
impl StructuralPartialEq for Utc
impl StructuralPartialEq for OutOfRange
impl StructuralPartialEq for OutOfRangeError
impl StructuralPartialEq for TimeDelta
impl StructuralPartialEq for ParseWeekdayError
impl StructuralPartialEq for AllocError
impl StructuralPartialEq for Domain
impl StructuralPartialEq for Elapsed
impl StructuralPartialEq for FilterOp
impl StructuralPartialEq for Id
impl StructuralPartialEq for Instant
impl StructuralPartialEq for Interest
impl StructuralPartialEq for Interest
impl StructuralPartialEq for MissedTickBehavior
impl StructuralPartialEq for OnceState
impl StructuralPartialEq for ParkResult
impl StructuralPartialEq for ParkToken
impl StructuralPartialEq for Protocol
impl StructuralPartialEq for Ready
impl StructuralPartialEq for RecvError
impl StructuralPartialEq for RecvError
impl StructuralPartialEq for RecvFlags
impl StructuralPartialEq for RequeueOp
impl StructuralPartialEq for RuntimeFlavor
impl StructuralPartialEq for SigId
impl StructuralPartialEq for SignalKind
impl StructuralPartialEq for Token
impl StructuralPartialEq for TryAcquireError
impl StructuralPartialEq for TryRecvError
impl StructuralPartialEq for TryRecvError
impl StructuralPartialEq for TryRecvError
impl StructuralPartialEq for TryReserveError
impl StructuralPartialEq for TryReserveError
impl StructuralPartialEq for TryReserveErrorKind
impl StructuralPartialEq for Type
impl StructuralPartialEq for UCred
impl StructuralPartialEq for UnparkResult
impl StructuralPartialEq for UnparkToken
impl StructuralPartialEq for WaitTimeoutResult
impl<'a> StructuralPartialEq for Utf8Pattern<'a>
impl<'a> StructuralPartialEq for Component<'a>
impl<'a> StructuralPartialEq for Prefix<'a>
impl<'a> StructuralPartialEq for Item<'a>
impl<'a> StructuralPartialEq for Location<'a>
impl<'a> StructuralPartialEq for Utf8Chunk<'a>
impl<B, C> StructuralPartialEq for ControlFlow<B, C>
impl<Idx> StructuralPartialEq for wiwi::prelude_std::ops::Range<Idx>
impl<Idx> StructuralPartialEq for wiwi::prelude_std::ops::RangeFrom<Idx>
impl<Idx> StructuralPartialEq for wiwi::prelude_std::ops::RangeInclusive<Idx>
impl<Idx> StructuralPartialEq for RangeTo<Idx>
impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>
impl<Idx> StructuralPartialEq for core::range::Range<Idx>
impl<Idx> StructuralPartialEq for core::range::RangeFrom<Idx>
impl<Idx> StructuralPartialEq for core::range::RangeInclusive<Idx>
impl<T> StructuralPartialEq for Option<T>
impl<T> StructuralPartialEq for Bound<T>
impl<T> StructuralPartialEq for Poll<T>
impl<T> StructuralPartialEq for std::sync::mpmc::error::SendTimeoutError<T>
impl<T> StructuralPartialEq for std::sync::mpsc::TrySendError<T>
impl<T> StructuralPartialEq for LocalResult<T>
impl<T> StructuralPartialEq for &Twhere
T: ?Sized,
impl<T> StructuralPartialEq for [T]
impl<T> StructuralPartialEq for (Tโ, Tโ, โฆ, Tโ)
This trait is implemented for tuples up to twelve items long.