Trait std::marker::StructuralPartialEq
source · pub trait StructuralPartialEq { }
structural_match
#31434)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 AsciiChar
impl StructuralPartialEq for BacktraceStatus
impl StructuralPartialEq for std::cmp::Ordering
impl StructuralPartialEq for TryReserveErrorKind
impl StructuralPartialEq for VarError
impl StructuralPartialEq for std::fmt::Alignment
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 BacktraceStyle
impl StructuralPartialEq for SearchStep
impl StructuralPartialEq for std::sync::atomic::Ordering
impl StructuralPartialEq for RecvTimeoutError
impl StructuralPartialEq for TryRecvError
impl StructuralPartialEq for DwarfFileType
impl StructuralPartialEq for Format
impl StructuralPartialEq for SectionId
impl StructuralPartialEq for Vendor
impl StructuralPartialEq for RunTimeEndian
impl StructuralPartialEq for AbbreviationsCacheStrategy
impl StructuralPartialEq for Pointer
impl StructuralPartialEq for gimli::read::Error
impl StructuralPartialEq for ColumnType
impl StructuralPartialEq for Value
impl StructuralPartialEq for ValueType
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 CpuidResult
impl StructuralPartialEq for AllocError
impl StructuralPartialEq for Layout
impl StructuralPartialEq for LayoutError
impl StructuralPartialEq for CharTryFromError
impl StructuralPartialEq for DecodeUtf16Error
impl StructuralPartialEq for ParseCharError
impl StructuralPartialEq for TryFromCharError
impl StructuralPartialEq for UnorderedKeyError
impl StructuralPartialEq for TryReserveError
impl StructuralPartialEq for FromBytesUntilNulError
impl StructuralPartialEq for FromBytesWithNulError
impl StructuralPartialEq for FromVecWithNulError
impl StructuralPartialEq for IntoStringError
impl StructuralPartialEq for NulError
impl StructuralPartialEq for CString
impl StructuralPartialEq for std::fmt::Error
impl StructuralPartialEq for FileType
impl StructuralPartialEq for Permissions
impl StructuralPartialEq for Assume
impl StructuralPartialEq for AddrParseError
impl StructuralPartialEq for Ipv4Addr
impl StructuralPartialEq for Ipv6Addr
impl StructuralPartialEq for SocketAddrV4
impl StructuralPartialEq for SocketAddrV6
impl StructuralPartialEq for ParseFloatError
impl StructuralPartialEq for ParseIntError
impl StructuralPartialEq for TryFromIntError
impl StructuralPartialEq for RangeFull
impl StructuralPartialEq for UCred
impl StructuralPartialEq for InvalidHandleError
impl StructuralPartialEq for NullHandleError
impl StructuralPartialEq for StripPrefixError
impl StructuralPartialEq for ExitStatus
impl StructuralPartialEq for ExitStatusError
impl StructuralPartialEq for Output
impl StructuralPartialEq for std::ptr::Alignment
impl StructuralPartialEq for ParseBoolError
impl StructuralPartialEq for Utf8Error
impl StructuralPartialEq for FromUtf8Error
impl StructuralPartialEq for String
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 TryFromFloatSecsError
impl StructuralPartialEq for DebugTypeSignature
impl StructuralPartialEq for DwoId
impl StructuralPartialEq for Encoding
impl StructuralPartialEq for LineEncoding
impl StructuralPartialEq for Register
impl StructuralPartialEq for DwAccess
impl StructuralPartialEq for DwAddr
impl StructuralPartialEq for DwAt
impl StructuralPartialEq for DwAte
impl StructuralPartialEq for DwCc
impl StructuralPartialEq for DwCfa
impl StructuralPartialEq for DwChildren
impl StructuralPartialEq for DwDefaulted
impl StructuralPartialEq for DwDs
impl StructuralPartialEq for DwDsc
impl StructuralPartialEq for DwEhPe
impl StructuralPartialEq for DwEnd
impl StructuralPartialEq for DwForm
impl StructuralPartialEq for DwId
impl StructuralPartialEq for DwIdx
impl StructuralPartialEq for DwInl
impl StructuralPartialEq for DwLang
impl StructuralPartialEq for DwLle
impl StructuralPartialEq for DwLnct
impl StructuralPartialEq for DwLne
impl StructuralPartialEq for DwLns
impl StructuralPartialEq for DwMacro
impl StructuralPartialEq for DwOp
impl StructuralPartialEq for DwOrd
impl StructuralPartialEq for DwRle
impl StructuralPartialEq for DwSect
impl StructuralPartialEq for DwSectV2
impl StructuralPartialEq for DwTag
impl StructuralPartialEq for DwUt
impl StructuralPartialEq for DwVirtuality
impl StructuralPartialEq for DwVis
impl StructuralPartialEq for BigEndian
impl StructuralPartialEq for LittleEndian
impl StructuralPartialEq for Abbreviation
impl StructuralPartialEq for AttributeSpecification
impl StructuralPartialEq for ArangeEntry
impl StructuralPartialEq for Augmentation
impl StructuralPartialEq for BaseAddresses
impl StructuralPartialEq for SectionBaseAddresses
impl StructuralPartialEq for UnitIndexSection
impl StructuralPartialEq for FileEntryFormat
impl StructuralPartialEq for LineRow
impl StructuralPartialEq for ReaderOffsetId
impl StructuralPartialEq for gimli::read::rnglists::Range
impl StructuralPartialEq for StoreOnHeap
impl StructuralPartialEq for PhantomPinned
impl<'a> StructuralPartialEq for Component<'a>
impl<'a> StructuralPartialEq for Prefix<'a>
impl<'a> StructuralPartialEq for std::panic::Location<'a>
impl<'a> StructuralPartialEq for Utf8Chunk<'a>
impl<'bases, Section, R> StructuralPartialEq for CieOrFde<'bases, Section, R>where
R: Reader,
Section: UnwindSection<R>,
impl<'bases, Section, R> StructuralPartialEq for PartialFrameDescriptionEntry<'bases, Section, R>where
R: Reader,
Section: UnwindSection<R>,
impl<'input, Endian> StructuralPartialEq for EndianSlice<'input, Endian>where
Endian: Endianity,
impl<B, C> StructuralPartialEq for ControlFlow<B, C>
impl<Idx> StructuralPartialEq for std::ops::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<Offset> StructuralPartialEq for UnitType<Offset>where
Offset: ReaderOffset,
impl<R> StructuralPartialEq for CallFrameInstruction<R>where
R: Reader,
impl<R> StructuralPartialEq for CfaRule<R>where
R: Reader,
impl<R> StructuralPartialEq for RegisterRule<R>where
R: Reader,
impl<R> StructuralPartialEq for EvaluationResult<R>where
R: Reader,
impl<R> StructuralPartialEq for DebugFrame<R>where
R: Reader,
impl<R> StructuralPartialEq for EhFrame<R>where
R: Reader,
impl<R> StructuralPartialEq for EhFrameHdr<R>where
R: Reader,
impl<R> StructuralPartialEq for LocationListEntry<R>where
R: Reader,
impl<R> StructuralPartialEq for Expression<R>where
R: Reader,
impl<R> StructuralPartialEq for Attribute<R>where
R: Reader,
impl<R, A> StructuralPartialEq for UnwindContext<R, A>where
R: Reader,
A: UnwindContextStorage<R>,
impl<R, Offset> StructuralPartialEq for LineInstruction<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for gimli::read::op::Location<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for Operation<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for AttributeValue<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for ArangeHeader<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for CommonInformationEntry<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for FrameDescriptionEntry<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for CompleteLineProgram<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for FileEntry<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for IncompleteLineProgram<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for LineProgramHeader<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for Piece<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, Offset> StructuralPartialEq for UnitHeader<R, Offset>where
R: Reader<Offset = Offset>,
Offset: ReaderOffset,
impl<R, S> StructuralPartialEq for UnwindTableRow<R, S>where
R: Reader,
S: UnwindContextStorage<R>,
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 UnitSectionOffset<T>
impl<T> StructuralPartialEq for DieReference<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.