Trait std::marker::StructuralPartialEq

source ยท
pub trait StructuralPartialEq { }
๐Ÿ”ฌThis is a nightly-only experimental API. (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ยง

sourceยง

impl StructuralPartialEq for AsciiChar

1.65.0 ยท sourceยง

impl StructuralPartialEq for BacktraceStatus

1.0.0 ยท sourceยง

impl StructuralPartialEq for std::cmp::Ordering

sourceยง

impl StructuralPartialEq for TryReserveErrorKind

1.0.0 ยท sourceยง

impl StructuralPartialEq for VarError

1.28.0 ยท sourceยง

impl StructuralPartialEq for std::fmt::Alignment

1.0.0 ยท sourceยง

impl StructuralPartialEq for ErrorKind

1.0.0 ยท sourceยง

impl StructuralPartialEq for SeekFrom

1.7.0 ยท sourceยง

impl StructuralPartialEq for IpAddr

sourceยง

impl StructuralPartialEq for Ipv6MulticastScope

1.0.0 ยท sourceยง

impl StructuralPartialEq for Shutdown

1.0.0 ยท sourceยง

impl StructuralPartialEq for SocketAddr

1.0.0 ยท sourceยง

impl StructuralPartialEq for FpCategory

1.55.0 ยท sourceยง

impl StructuralPartialEq for IntErrorKind

sourceยง

impl StructuralPartialEq for BacktraceStyle

sourceยง

impl StructuralPartialEq for SearchStep

1.0.0 ยท sourceยง

impl StructuralPartialEq for std::sync::atomic::Ordering

1.12.0 ยท sourceยง

impl StructuralPartialEq for RecvTimeoutError

1.0.0 ยท sourceยง

impl StructuralPartialEq for TryRecvError

sourceยง

impl StructuralPartialEq for DwarfFileType

sourceยง

impl StructuralPartialEq for Format

sourceยง

impl StructuralPartialEq for SectionId

sourceยง

impl StructuralPartialEq for Vendor

sourceยง

impl StructuralPartialEq for RunTimeEndian

sourceยง

impl StructuralPartialEq for AbbreviationsCacheStrategy

sourceยง

impl StructuralPartialEq for Pointer

sourceยง

impl StructuralPartialEq for gimli::read::Error

sourceยง

impl StructuralPartialEq for ColumnType

sourceยง

impl StructuralPartialEq for Value

sourceยง

impl StructuralPartialEq for ValueType

sourceยง

impl StructuralPartialEq for bool

sourceยง

impl StructuralPartialEq for char

sourceยง

impl StructuralPartialEq for i8

sourceยง

impl StructuralPartialEq for i16

sourceยง

impl StructuralPartialEq for i32

sourceยง

impl StructuralPartialEq for i64

sourceยง

impl StructuralPartialEq for i128

sourceยง

impl StructuralPartialEq for isize

sourceยง

impl StructuralPartialEq for str

sourceยง

impl StructuralPartialEq for u8

sourceยง

impl StructuralPartialEq for u16

sourceยง

impl StructuralPartialEq for u32

sourceยง

impl StructuralPartialEq for u64

sourceยง

impl StructuralPartialEq for u128

sourceยง

impl StructuralPartialEq for ()

sourceยง

impl StructuralPartialEq for usize

1.27.0 ยท sourceยง

impl StructuralPartialEq for CpuidResult

sourceยง

impl StructuralPartialEq for AllocError

1.28.0 ยท sourceยง

impl StructuralPartialEq for Layout

1.50.0 ยท sourceยง

impl StructuralPartialEq for LayoutError

1.34.0 ยท sourceยง

impl StructuralPartialEq for CharTryFromError

1.9.0 ยท sourceยง

impl StructuralPartialEq for DecodeUtf16Error

1.20.0 ยท sourceยง

impl StructuralPartialEq for ParseCharError

1.59.0 ยท sourceยง

impl StructuralPartialEq for TryFromCharError

sourceยง

impl StructuralPartialEq for UnorderedKeyError

1.57.0 ยท sourceยง

impl StructuralPartialEq for TryReserveError

1.69.0 ยท sourceยง

impl StructuralPartialEq for FromBytesUntilNulError

1.64.0 ยท sourceยง

impl StructuralPartialEq for FromBytesWithNulError

1.64.0 ยท sourceยง

impl StructuralPartialEq for FromVecWithNulError

1.64.0 ยท sourceยง

impl StructuralPartialEq for IntoStringError

1.64.0 ยท sourceยง

impl StructuralPartialEq for NulError

1.64.0 ยท sourceยง

impl StructuralPartialEq for CString

1.0.0 ยท sourceยง

impl StructuralPartialEq for std::fmt::Error

1.1.0 ยท sourceยง

impl StructuralPartialEq for FileType

1.0.0 ยท sourceยง

impl StructuralPartialEq for Permissions

sourceยง

impl StructuralPartialEq for Assume

1.0.0 ยท sourceยง

impl StructuralPartialEq for AddrParseError

1.0.0 ยท sourceยง

impl StructuralPartialEq for Ipv4Addr

1.0.0 ยท sourceยง

impl StructuralPartialEq for Ipv6Addr

1.0.0 ยท sourceยง

impl StructuralPartialEq for SocketAddrV4

1.0.0 ยท sourceยง

impl StructuralPartialEq for SocketAddrV6

1.0.0 ยท sourceยง

impl StructuralPartialEq for ParseFloatError

1.0.0 ยท sourceยง

impl StructuralPartialEq for ParseIntError

1.34.0 ยท sourceยง

impl StructuralPartialEq for TryFromIntError

1.0.0 ยท sourceยง

impl StructuralPartialEq for RangeFull

sourceยง

impl StructuralPartialEq for UCred

Available on Unix only.
1.63.0 ยท sourceยง

impl StructuralPartialEq for InvalidHandleError

Available on Windows only.
1.63.0 ยท sourceยง

impl StructuralPartialEq for NullHandleError

Available on Windows only.
1.7.0 ยท sourceยง

impl StructuralPartialEq for StripPrefixError

1.0.0 ยท sourceยง

impl StructuralPartialEq for ExitStatus

sourceยง

impl StructuralPartialEq for ExitStatusError

1.0.0 ยท sourceยง

impl StructuralPartialEq for Output

sourceยง

impl StructuralPartialEq for std::ptr::Alignment

1.0.0 ยท sourceยง

impl StructuralPartialEq for ParseBoolError

1.0.0 ยท sourceยง

impl StructuralPartialEq for Utf8Error

1.0.0 ยท sourceยง

impl StructuralPartialEq for FromUtf8Error

1.0.0 ยท sourceยง

impl StructuralPartialEq for String

1.0.0 ยท sourceยง

impl StructuralPartialEq for RecvError

1.5.0 ยท sourceยง

impl StructuralPartialEq for WaitTimeoutResult

1.36.0 ยท sourceยง

impl StructuralPartialEq for RawWaker

1.36.0 ยท sourceยง

impl StructuralPartialEq for RawWakerVTable

1.26.0 ยท sourceยง

impl StructuralPartialEq for AccessError

1.19.0 ยท sourceยง

impl StructuralPartialEq for ThreadId

1.3.0 ยท sourceยง

impl StructuralPartialEq for Duration

1.8.0 ยท sourceยง

impl StructuralPartialEq for Instant

1.8.0 ยท sourceยง

impl StructuralPartialEq for SystemTime

1.66.0 ยท sourceยง

impl StructuralPartialEq for TryFromFloatSecsError

sourceยง

impl StructuralPartialEq for DebugTypeSignature

sourceยง

impl StructuralPartialEq for DwoId

sourceยง

impl StructuralPartialEq for Encoding

sourceยง

impl StructuralPartialEq for LineEncoding

sourceยง

impl StructuralPartialEq for Register

sourceยง

impl StructuralPartialEq for DwAccess

sourceยง

impl StructuralPartialEq for DwAddr

sourceยง

impl StructuralPartialEq for DwAt

sourceยง

impl StructuralPartialEq for DwAte

sourceยง

impl StructuralPartialEq for DwCc

sourceยง

impl StructuralPartialEq for DwCfa

sourceยง

impl StructuralPartialEq for DwChildren

sourceยง

impl StructuralPartialEq for DwDefaulted

sourceยง

impl StructuralPartialEq for DwDs

sourceยง

impl StructuralPartialEq for DwDsc

sourceยง

impl StructuralPartialEq for DwEhPe

sourceยง

impl StructuralPartialEq for DwEnd

sourceยง

impl StructuralPartialEq for DwForm

sourceยง

impl StructuralPartialEq for DwId

sourceยง

impl StructuralPartialEq for DwIdx

sourceยง

impl StructuralPartialEq for DwInl

sourceยง

impl StructuralPartialEq for DwLang

sourceยง

impl StructuralPartialEq for DwLle

sourceยง

impl StructuralPartialEq for DwLnct

sourceยง

impl StructuralPartialEq for DwLne

sourceยง

impl StructuralPartialEq for DwLns

sourceยง

impl StructuralPartialEq for DwMacro

sourceยง

impl StructuralPartialEq for DwOp

sourceยง

impl StructuralPartialEq for DwOrd

sourceยง

impl StructuralPartialEq for DwRle

sourceยง

impl StructuralPartialEq for DwSect

sourceยง

impl StructuralPartialEq for DwSectV2

sourceยง

impl StructuralPartialEq for DwTag

sourceยง

impl StructuralPartialEq for DwUt

sourceยง

impl StructuralPartialEq for DwVirtuality

sourceยง

impl StructuralPartialEq for DwVis

sourceยง

impl StructuralPartialEq for BigEndian

sourceยง

impl StructuralPartialEq for LittleEndian

sourceยง

impl StructuralPartialEq for Abbreviation

sourceยง

impl StructuralPartialEq for AttributeSpecification

sourceยง

impl StructuralPartialEq for ArangeEntry

sourceยง

impl StructuralPartialEq for Augmentation

sourceยง

impl StructuralPartialEq for BaseAddresses

sourceยง

impl StructuralPartialEq for SectionBaseAddresses

sourceยง

impl StructuralPartialEq for UnitIndexSection

sourceยง

impl StructuralPartialEq for FileEntryFormat

sourceยง

impl StructuralPartialEq for LineRow

sourceยง

impl StructuralPartialEq for ReaderOffsetId

sourceยง

impl StructuralPartialEq for gimli::read::rnglists::Range

sourceยง

impl StructuralPartialEq for StoreOnHeap

1.33.0 ยท sourceยง

impl StructuralPartialEq for PhantomPinned

1.0.0 ยท sourceยง

impl<'a> StructuralPartialEq for Component<'a>

1.0.0 ยท sourceยง

impl<'a> StructuralPartialEq for Prefix<'a>

1.10.0 ยท sourceยง

impl<'a> StructuralPartialEq for std::panic::Location<'a>

1.79.0 ยท sourceยง

impl<'a> StructuralPartialEq for Utf8Chunk<'a>

sourceยง

impl<'bases, Section, R> StructuralPartialEq for CieOrFde<'bases, Section, R>
where R: Reader, Section: UnwindSection<R>,

sourceยง

impl<'bases, Section, R> StructuralPartialEq for PartialFrameDescriptionEntry<'bases, Section, R>
where R: Reader, Section: UnwindSection<R>,

sourceยง

impl<'input, Endian> StructuralPartialEq for EndianSlice<'input, Endian>
where Endian: Endianity,

1.55.0 ยท sourceยง

impl<B, C> StructuralPartialEq for ControlFlow<B, C>

1.0.0 ยท sourceยง

impl<Idx> StructuralPartialEq for std::ops::Range<Idx>

1.0.0 ยท sourceยง

impl<Idx> StructuralPartialEq for RangeFrom<Idx>

1.26.0 ยท sourceยง

impl<Idx> StructuralPartialEq for RangeInclusive<Idx>

1.0.0 ยท sourceยง

impl<Idx> StructuralPartialEq for RangeTo<Idx>

1.26.0 ยท sourceยง

impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>

sourceยง

impl<Offset> StructuralPartialEq for UnitType<Offset>
where Offset: ReaderOffset,

sourceยง

impl<R> StructuralPartialEq for CallFrameInstruction<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for CfaRule<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for RegisterRule<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for EvaluationResult<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for DebugFrame<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for EhFrame<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for EhFrameHdr<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for LocationListEntry<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for Expression<R>
where R: Reader,

sourceยง

impl<R> StructuralPartialEq for Attribute<R>
where R: Reader,

sourceยง

impl<R, A> StructuralPartialEq for UnwindContext<R, A>
where R: Reader, A: UnwindContextStorage<R>,

sourceยง

impl<R, Offset> StructuralPartialEq for LineInstruction<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for gimli::read::op::Location<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for Operation<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for AttributeValue<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for ArangeHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for CommonInformationEntry<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for FrameDescriptionEntry<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for CompleteLineProgram<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for FileEntry<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for IncompleteLineProgram<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for LineProgramHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for Piece<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, Offset> StructuralPartialEq for UnitHeader<R, Offset>
where R: Reader<Offset = Offset>, Offset: ReaderOffset,

sourceยง

impl<R, S> StructuralPartialEq for UnwindTableRow<R, S>
where R: Reader, S: UnwindContextStorage<R>,

1.17.0 ยท sourceยง

impl<T> StructuralPartialEq for Bound<T>

1.0.0 ยท sourceยง

impl<T> StructuralPartialEq for Option<T>

1.0.0 ยท sourceยง

impl<T> StructuralPartialEq for TrySendError<T>

1.36.0 ยท sourceยง

impl<T> StructuralPartialEq for Poll<T>

sourceยง

impl<T> StructuralPartialEq for UnitSectionOffset<T>

sourceยง

impl<T> StructuralPartialEq for DieReference<T>

sourceยง

impl<T> StructuralPartialEq for &T
where T: ?Sized,

sourceยง

impl<T> StructuralPartialEq for [T]

sourceยง

impl<T> StructuralPartialEq for (Tโ‚, Tโ‚‚, โ€ฆ, Tโ‚™)

This trait is implemented for tuples up to twelve items long.

1.19.0 ยท sourceยง

impl<T> StructuralPartialEq for Reverse<T>

1.0.0 ยท sourceยง

impl<T> StructuralPartialEq for Cursor<T>

1.20.0 ยท sourceยง

impl<T> StructuralPartialEq for ManuallyDrop<T>
where T: ?Sized,

sourceยง

impl<T> StructuralPartialEq for NonZero<T>

1.74.0 ยท sourceยง

impl<T> StructuralPartialEq for Saturating<T>

1.0.0 ยท sourceยง

impl<T> StructuralPartialEq for Wrapping<T>

1.0.0 ยท sourceยง

impl<T> StructuralPartialEq for SendError<T>

sourceยง

impl<T> StructuralPartialEq for DebugAbbrevOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugAddrBase<T>

sourceยง

impl<T> StructuralPartialEq for DebugAddrIndex<T>

sourceยง

impl<T> StructuralPartialEq for DebugArangesOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugFrameOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugInfoOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugLineOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugLineStrOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugLocListsBase<T>

sourceยง

impl<T> StructuralPartialEq for DebugLocListsIndex<T>

sourceยง

impl<T> StructuralPartialEq for DebugMacinfoOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugMacroOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugRngListsBase<T>

sourceยง

impl<T> StructuralPartialEq for DebugRngListsIndex<T>

sourceยง

impl<T> StructuralPartialEq for DebugStrOffset<T>

sourceยง

impl<T> StructuralPartialEq for DebugStrOffsetsBase<T>

sourceยง

impl<T> StructuralPartialEq for DebugStrOffsetsIndex<T>

sourceยง

impl<T> StructuralPartialEq for DebugTypesOffset<T>

sourceยง

impl<T> StructuralPartialEq for EhFrameOffset<T>

sourceยง

impl<T> StructuralPartialEq for LocationListsOffset<T>

sourceยง

impl<T> StructuralPartialEq for RangeListsOffset<T>

sourceยง

impl<T> StructuralPartialEq for RawRangeListsOffset<T>

sourceยง

impl<T> StructuralPartialEq for UnitOffset<T>

sourceยง

impl<T> StructuralPartialEq for PhantomData<T>
where T: ?Sized,

1.0.0 ยท sourceยง

impl<T, E> StructuralPartialEq for Result<T, E>

sourceยง

impl<T, const N: usize> StructuralPartialEq for [T; N]

sourceยง

impl<Y, R> StructuralPartialEq for CoroutineState<Y, R>