Trait core::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 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.
Implementors§
impl StructuralPartialEq for AsciiChar
impl StructuralPartialEq for CharErrorKind
impl StructuralPartialEq for core::cmp::Ordering
impl StructuralPartialEq for Which
impl StructuralPartialEq for FromBytesWithNulErrorKind
impl StructuralPartialEq for core::fmt::Alignment
impl StructuralPartialEq for core::fmt::rt::Alignment
impl StructuralPartialEq for IpAddr
impl StructuralPartialEq for Ipv6MulticastScope
impl StructuralPartialEq for AddrKind
impl StructuralPartialEq for SocketAddr
impl StructuralPartialEq for FloatErrorKind
impl StructuralPartialEq for FpCategory
impl StructuralPartialEq for IntErrorKind
impl StructuralPartialEq for FullDecoded
impl StructuralPartialEq for Sign
impl StructuralPartialEq for AlignmentEnum16
impl StructuralPartialEq for AlignmentEnum32
impl StructuralPartialEq for AlignmentEnum64
impl StructuralPartialEq for SearchStep
impl StructuralPartialEq for core::sync::atomic::Ordering
impl StructuralPartialEq for TryFromFloatSecsErrorKind
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 Layout
impl StructuralPartialEq for LayoutError
impl StructuralPartialEq for AllocError
impl StructuralPartialEq for CharTryFromError
impl StructuralPartialEq for ParseCharError
impl StructuralPartialEq for DecodeUtf16Error
impl StructuralPartialEq for TryFromCharError
impl StructuralPartialEq for f32x2
impl StructuralPartialEq for f32x4
impl StructuralPartialEq for f32x8
impl StructuralPartialEq for f32x16
impl StructuralPartialEq for f64x1
impl StructuralPartialEq for f64x2
impl StructuralPartialEq for f64x4
impl StructuralPartialEq for f64x8
impl StructuralPartialEq for i8x2
impl StructuralPartialEq for i8x4
impl StructuralPartialEq for i8x8
impl StructuralPartialEq for i8x16
impl StructuralPartialEq for i8x32
impl StructuralPartialEq for i8x64
impl StructuralPartialEq for i16x2
impl StructuralPartialEq for i16x4
impl StructuralPartialEq for i16x8
impl StructuralPartialEq for i16x16
impl StructuralPartialEq for i16x32
impl StructuralPartialEq for i32x2
impl StructuralPartialEq for i32x4
impl StructuralPartialEq for i32x8
impl StructuralPartialEq for i32x16
impl StructuralPartialEq for i64x1
impl StructuralPartialEq for i64x2
impl StructuralPartialEq for i64x4
impl StructuralPartialEq for i64x8
impl StructuralPartialEq for m8x16
impl StructuralPartialEq for m16x8
impl StructuralPartialEq for m32x4
impl StructuralPartialEq for m64x2
impl StructuralPartialEq for u8x2
impl StructuralPartialEq for u8x4
impl StructuralPartialEq for u8x8
impl StructuralPartialEq for u8x16
impl StructuralPartialEq for u8x32
impl StructuralPartialEq for u8x64
impl StructuralPartialEq for u16x2
impl StructuralPartialEq for u16x4
impl StructuralPartialEq for u16x8
impl StructuralPartialEq for u16x16
impl StructuralPartialEq for u16x32
impl StructuralPartialEq for u32x2
impl StructuralPartialEq for u32x4
impl StructuralPartialEq for u32x8
impl StructuralPartialEq for u32x16
impl StructuralPartialEq for u64x1
impl StructuralPartialEq for u64x2
impl StructuralPartialEq for u64x4
impl StructuralPartialEq for u64x8
impl StructuralPartialEq for CpuidResult
impl StructuralPartialEq for FromBytesUntilNulError
impl StructuralPartialEq for FromBytesWithNulError
impl StructuralPartialEq for Binary
impl StructuralPartialEq for LowerHex
impl StructuralPartialEq for Octal
impl StructuralPartialEq for UpperHex
impl StructuralPartialEq for Error
impl StructuralPartialEq for Assume
impl StructuralPartialEq for Ipv4Addr
impl StructuralPartialEq for Ipv6Addr
impl StructuralPartialEq for AddrParseError
impl StructuralPartialEq for SocketAddrV4
impl StructuralPartialEq for SocketAddrV6
impl StructuralPartialEq for BiasedFp
impl StructuralPartialEq for Number
impl StructuralPartialEq for ParseIntError
impl StructuralPartialEq for TryFromIntError
impl StructuralPartialEq for Decoded
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 IndexRange
impl StructuralPartialEq for RangeFull
impl StructuralPartialEq for core::ptr::alignment::Alignment
impl StructuralPartialEq for ParseBoolError
impl StructuralPartialEq for Utf8Error
impl StructuralPartialEq for RawWaker
impl StructuralPartialEq for RawWakerVTable
impl StructuralPartialEq for Duration
impl StructuralPartialEq for Nanoseconds
impl StructuralPartialEq for TryFromFloatSecsError
impl StructuralPartialEq for PhantomPinned
impl<'a> StructuralPartialEq for Part<'a>
impl<'a> StructuralPartialEq for Location<'a>
impl<'a> StructuralPartialEq for Utf8Chunk<'a>
impl<A, Z, Y, X, W, V, U, T> StructuralPartialEq for (A, Z, Y, X, W, V, U, T)
impl<B, A, Z, Y, X, W, V, U, T> StructuralPartialEq for (B, A, Z, Y, X, W, V, U, T)
impl<B, C> StructuralPartialEq for ControlFlow<B, C>
impl<C, B, A, Z, Y, X, W, V, U, T> StructuralPartialEq for (C, B, A, Z, Y, X, W, V, U, T)
impl<D, C, B, A, Z, Y, X, W, V, U, T> StructuralPartialEq for (D, C, B, A, Z, Y, X, W, V, U, T)
impl<E, D, C, B, A, Z, Y, X, W, V, U, T> StructuralPartialEq for (E, D, C, B, A, Z, Y, X, W, V, U, T)
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 Poll<T>
impl<T> StructuralPartialEq for [T]
impl<T> StructuralPartialEq for (T₁, T₂, …, Tₙ)
This trait is implemented for tuples up to twelve items long.