# Trait std::marker::StructuralPartialEq
[−][src]

    pub trait StructuralPartialEq { }

🔬 This is a nightly-only experimental API. (`structural_match` #31434)

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<'a> StructuralPartialEq for Utf8LossyChunk<'a>`[src]

### `impl StructuralPartialEq for CpuidResult`[src]

Loading content...

## Implementors

### `impl StructuralPartialEq for BacktraceStatus`[src]

### `impl StructuralPartialEq for std::cmp::Ordering` 1.0.0[src]

### `impl StructuralPartialEq for TryReserveError`[src]

### `impl StructuralPartialEq for VarError` 1.0.0[src]

### `impl StructuralPartialEq for ErrorKind` 1.0.0[src]

### `impl StructuralPartialEq for SeekFrom` 1.0.0[src]

### `impl StructuralPartialEq for IpAddr` 1.7.0[src]

### `impl StructuralPartialEq for Ipv6MulticastScope`[src]

### `impl StructuralPartialEq for Shutdown` 1.0.0[src]

### `impl StructuralPartialEq for SocketAddr` 1.0.0[src]

### `impl StructuralPartialEq for FpCategory` 1.0.0[src]

### `impl StructuralPartialEq for IntErrorKind`[src]

### `impl StructuralPartialEq for SearchStep`[src]

### `impl StructuralPartialEq for std::sync::atomic::Ordering` 1.0.0[src]

### `impl StructuralPartialEq for RecvTimeoutError` 1.12.0[src]

### `impl StructuralPartialEq for TryRecvError` 1.0.0[src]

### `impl StructuralPartialEq for AllocError`[src]

### `impl StructuralPartialEq for Layout` 1.28.0[src]

### `impl StructuralPartialEq for LayoutError` 1.50.0[src]

### `impl StructuralPartialEq for TypeId` 1.0.0[src]

### `impl StructuralPartialEq for CharTryFromError` 1.34.0[src]

### `impl StructuralPartialEq for DecodeUtf16Error` 1.9.0[src]

### `impl StructuralPartialEq for ParseCharError` 1.20.0[src]

### `impl StructuralPartialEq for CString` 1.0.0[src]

### `impl StructuralPartialEq for FromBytesWithNulError` 1.10.0[src]

### `impl StructuralPartialEq for FromVecWithNulError`[src]

### `impl StructuralPartialEq for IntoStringError` 1.7.0[src]

### `impl StructuralPartialEq for NulError` 1.0.0[src]

### `impl StructuralPartialEq for Error` 1.0.0[src]

### `impl StructuralPartialEq for FileType` 1.1.0[src]

### `impl StructuralPartialEq for Permissions` 1.0.0[src]

### `impl StructuralPartialEq for AddrParseError` 1.0.0[src]

### `impl StructuralPartialEq for NonZeroI8` 1.34.0[src]

### `impl StructuralPartialEq for NonZeroI16` 1.34.0[src]

### `impl StructuralPartialEq for NonZeroI32` 1.34.0[src]

### `impl StructuralPartialEq for NonZeroI64` 1.34.0[src]

### `impl StructuralPartialEq for NonZeroI128` 1.34.0[src]

### `impl StructuralPartialEq for NonZeroIsize` 1.34.0[src]

### `impl StructuralPartialEq for NonZeroU8` 1.28.0[src]

### `impl StructuralPartialEq for NonZeroU16` 1.28.0[src]

### `impl StructuralPartialEq for NonZeroU32` 1.28.0[src]

### `impl StructuralPartialEq for NonZeroU64` 1.28.0[src]

### `impl StructuralPartialEq for NonZeroU128` 1.28.0[src]

### `impl StructuralPartialEq for NonZeroUsize` 1.28.0[src]

### `impl StructuralPartialEq for ParseFloatError` 1.0.0[src]

### `impl StructuralPartialEq for ParseIntError` 1.0.0[src]

### `impl StructuralPartialEq for TryFromIntError` 1.34.0[src]

### `impl StructuralPartialEq for RangeFull` 1.0.0[src]

### `impl StructuralPartialEq for NoneError`[src]

### `impl StructuralPartialEq for UCred`[src]

This is supported on Unix only.

### `impl StructuralPartialEq for StripPrefixError` 1.7.0[src]

### `impl StructuralPartialEq for ExitStatus` 1.0.0[src]

### `impl StructuralPartialEq for Output` 1.0.0[src]

### `impl StructuralPartialEq for ParseBoolError` 1.0.0[src]

### `impl StructuralPartialEq for Utf8Error` 1.0.0[src]

### `impl StructuralPartialEq for FromUtf8Error` 1.0.0[src]

### `impl StructuralPartialEq for RecvError` 1.0.0[src]

### `impl StructuralPartialEq for WaitTimeoutResult` 1.5.0[src]

### `impl StructuralPartialEq for RawWaker` 1.36.0[src]

### `impl StructuralPartialEq for RawWakerVTable` 1.36.0[src]

### `impl StructuralPartialEq for AccessError` 1.26.0[src]

### `impl StructuralPartialEq for ThreadId` 1.19.0[src]

### `impl StructuralPartialEq for Duration` 1.3.0[src]

### `impl StructuralPartialEq for Instant` 1.8.0[src]

### `impl StructuralPartialEq for SystemTime` 1.8.0[src]

### `impl StructuralPartialEq for PhantomPinned` 1.33.0[src]

### `impl<'a> StructuralPartialEq for Component<'a>`1.0.0[src]

### `impl<'a> StructuralPartialEq for Prefix<'a>`1.0.0[src]

### `impl<'a> StructuralPartialEq for Location<'a>`1.10.0[src]

### `impl<B, C> StructuralPartialEq for ControlFlow<B, C>`[src]

### `impl<Idx> StructuralPartialEq for Range<Idx>`1.0.0[src]

### `impl<Idx> StructuralPartialEq for RangeFrom<Idx>`1.0.0[src]

### `impl<Idx> StructuralPartialEq for RangeInclusive<Idx>`1.26.0[src]

### `impl<Idx> StructuralPartialEq for RangeTo<Idx>`1.0.0[src]

### `impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>`1.26.0[src]

### `impl<T> StructuralPartialEq for Bound<T>`1.17.0[src]

### `impl<T> StructuralPartialEq for Option<T>`1.0.0[src]

### `impl<T> StructuralPartialEq for TrySendError<T>`1.0.0[src]

### `impl<T> StructuralPartialEq for Poll<T>`1.36.0[src]

### `impl<T> StructuralPartialEq for Reverse<T>`1.19.0[src]

### `impl<T> StructuralPartialEq for BTreeSet<T>`1.0.0[src]

### `impl<T> StructuralPartialEq for Cursor<T>`1.0.0[src]

### `impl<T> StructuralPartialEq for ManuallyDrop<T> where
T: ?Sized,` 1.20.0[src]

### `impl<T> StructuralPartialEq for Wrapping<T>`1.0.0[src]

### `impl<T> StructuralPartialEq for SendError<T>`1.0.0[src]

### `impl<T> StructuralPartialEq for PhantomData<T> where
T: ?Sized,` [src]

### `impl<T, E> StructuralPartialEq for Result<T, E>`1.0.0[src]

### `impl<Y, R> StructuralPartialEq for GeneratorState<Y, R>`[src]

Loading content...