Trait StructuralPartialEq

Source
pub trait StructuralPartialEq { }
🔬This is a nightly-only experimental API. (structural_match)
Expand description

Required trait for constants used in pattern matches.

Constants are only allowed as patterns if (a) their type implements PartialEq, and (b) interpreting the value of the constant as a pattern is equialent to calling PartialEq. This ensures that constants used as patterns cannot expose implementation details in an unexpected way or cause semver hazards.

This trait ensures point (b). Any type that derives PartialEq automatically implements this trait.

Implementing this trait (which is unstable) is a way for type authors to explicitly allow comparing const values of this type; that operation will recursively compare all fields (including private fields), even if that behavior differs from PartialEq. This can make it semver-breaking to add further private fields to a type.

Implementors§

Source§

impl StructuralPartialEq for AsciiChar

1.65.0 · Source§

impl StructuralPartialEq for BacktraceStatus

1.0.0 · Source§

impl StructuralPartialEq for creusot_contracts::std::cmp::Ordering

1.0.0 · Source§

impl StructuralPartialEq for VarError

1.64.0 · Source§

impl StructuralPartialEq for FromBytesWithNulError

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 GetManyMutError

Source§

impl StructuralPartialEq for SearchStep

Source§

impl StructuralPartialEq for TryReserveErrorKind

1.28.0 · Source§

impl StructuralPartialEq for core::fmt::Alignment

Source§

impl StructuralPartialEq for DebugAsHex

Source§

impl StructuralPartialEq for core::fmt::Sign

1.0.0 · Source§

impl StructuralPartialEq for core::sync::atomic::Ordering

1.12.0 · Source§

impl StructuralPartialEq for RecvTimeoutError

1.0.0 · Source§

impl StructuralPartialEq for TryRecvError

Source§

impl StructuralPartialEq for _Unwind_Action

Source§

impl StructuralPartialEq for _Unwind_Reason_Code

Source§

impl StructuralPartialEq for num_bigint::bigint::Sign

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

Source§

impl StructuralPartialEq for AllocError

1.28.0 · Source§

impl StructuralPartialEq for Layout

1.50.0 · Source§

impl StructuralPartialEq for LayoutError

1.27.0 · Source§

impl StructuralPartialEq for CpuidResult

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

1.64.0 · Source§

impl StructuralPartialEq for CStr

1.64.0 · Source§

impl StructuralPartialEq for CString

1.69.0 · Source§

impl StructuralPartialEq for FromBytesUntilNulError

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.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

1.7.0 · Source§

impl StructuralPartialEq for StripPrefixError

1.0.0 · Source§

impl StructuralPartialEq for String

1.61.0 · Source§

impl StructuralPartialEq for ExitCode

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 creusot_contracts::std::ptr::Alignment

1.0.0 · Source§

impl StructuralPartialEq for ParseBoolError

1.0.0 · Source§

impl StructuralPartialEq for Utf8Error

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 UnorderedKeyError

1.57.0 · Source§

impl StructuralPartialEq for TryReserveError

1.0.0 · Source§

impl StructuralPartialEq for FromUtf8Error

1.0.0 · Source§

impl StructuralPartialEq for Error

Source§

impl StructuralPartialEq for FormattingOptions

1.0.0 · Source§

impl StructuralPartialEq for RecvError

1.5.0 · Source§

impl StructuralPartialEq for WaitTimeoutResult

Source§

impl StructuralPartialEq for ParseBigIntError

Source§

impl StructuralPartialEq for ParseRatioError

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>

Source§

impl<'a> StructuralPartialEq for Utf8Pattern<'a>

1.10.0 · Source§

impl<'a> StructuralPartialEq for Location<'a>

1.79.0 · Source§

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

Source§

impl<'a> StructuralPartialEq for PhantomContravariantLifetime<'a>

Source§

impl<'a> StructuralPartialEq for PhantomCovariantLifetime<'a>

Source§

impl<'a> StructuralPartialEq for PhantomInvariantLifetime<'a>

Source§

impl<A> StructuralPartialEq for ExtendedGcd<A>

1.55.0 · Source§

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

1.0.0 · Source§

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

1.0.0 · Source§

impl<Idx> StructuralPartialEq for creusot_contracts::std::ops::RangeFrom<Idx>

1.26.0 · Source§

impl<Idx> StructuralPartialEq for creusot_contracts::std::ops::RangeInclusive<Idx>

1.0.0 · Source§

impl<Idx> StructuralPartialEq for RangeTo<Idx>

1.26.0 · Source§

impl<Idx> StructuralPartialEq for RangeToInclusive<Idx>

Source§

impl<Idx> StructuralPartialEq for core::range::Range<Idx>

Source§

impl<Idx> StructuralPartialEq for core::range::RangeFrom<Idx>

Source§

impl<Idx> StructuralPartialEq for core::range::RangeInclusive<Idx>

1.17.0 · Source§

impl<T> StructuralPartialEq for Bound<T>

1.0.0 · Source§

impl<T> StructuralPartialEq for Option<T>

1.36.0 · Source§

impl<T> StructuralPartialEq for Poll<T>

Source§

impl<T> StructuralPartialEq for SendTimeoutError<T>

1.0.0 · Source§

impl<T> StructuralPartialEq for TrySendError<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 TryFromBigIntError<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>