pub trait StructuralPartialEq { }structural_match #31434)Expand description
Required trait for constants used in pattern matches.
Constants are only allowed as patterns if (a) their type implementsPartialEq, and (b) interpreting the value of the constant as a patternis equivalent to callingPartialEq. This ensures that constants used aspatterns cannot expose implementation details in an unexpected way orcause semver hazards.
This trait ensures point (b).Any type that derivesPartialEq automatically implements this trait.
Implementing this trait (which is unstable) is a way for type authors to explicitly allowcomparing const values of this type; that operation will recursively compare all fields(including private fields), even if that behavior differs fromPartialEq. This can make itsemver-breaking to add further private fields to a type.
Implementors§
implStructuralPartialEq forAsciiChar
implStructuralPartialEq forBacktraceStatus
implStructuralPartialEq for std::cmp::Ordering
implStructuralPartialEq forTryReserveErrorKind
implStructuralPartialEq forVarError
implStructuralPartialEq forFromBytesWithNulError
implStructuralPartialEq for std::fmt::Alignment
implStructuralPartialEq forDebugAsHex
implStructuralPartialEq forSign
implStructuralPartialEq forAtomicOrdering
implStructuralPartialEq forSimdAlign
implStructuralPartialEq forErrorKind
implStructuralPartialEq forSeekFrom
implStructuralPartialEq forIpAddr
implStructuralPartialEq forIpv6MulticastScope
implStructuralPartialEq forShutdown
implStructuralPartialEq forSocketAddr
implStructuralPartialEq forFpCategory
implStructuralPartialEq forIntErrorKind
implStructuralPartialEq forBacktraceStyle
implStructuralPartialEq forGetDisjointMutError
implStructuralPartialEq forSearchStep
implStructuralPartialEq for std::sync::atomic::Ordering
implStructuralPartialEq forRecvTimeoutError
implStructuralPartialEq forTryRecvError
implStructuralPartialEq forbool
implStructuralPartialEq forchar
implStructuralPartialEq fori8
implStructuralPartialEq fori16
implStructuralPartialEq fori32
implStructuralPartialEq fori64
implStructuralPartialEq fori128
implStructuralPartialEq forisize
implStructuralPartialEq forstr
implStructuralPartialEq foru8
implStructuralPartialEq foru16
implStructuralPartialEq foru32
implStructuralPartialEq foru64
implStructuralPartialEq foru128
implStructuralPartialEq for()
implStructuralPartialEq forusize
implStructuralPartialEq forCpuidResult
implStructuralPartialEq forAllocError
implStructuralPartialEq forLayout
implStructuralPartialEq forLayoutError
implStructuralPartialEq forCharTryFromError
implStructuralPartialEq forDecodeUtf16Error
implStructuralPartialEq forParseCharError
implStructuralPartialEq forTryFromCharError
implStructuralPartialEq forUnorderedKeyError
implStructuralPartialEq forTryReserveError
implStructuralPartialEq forCStr
implStructuralPartialEq forCString
implStructuralPartialEq forFromBytesUntilNulError
implStructuralPartialEq forFromVecWithNulError
implStructuralPartialEq forIntoStringError
implStructuralPartialEq forNulError
implStructuralPartialEq forError
implStructuralPartialEq forFormattingOptions
implStructuralPartialEq forFileType
implStructuralPartialEq forPermissions
implStructuralPartialEq forAssume
implStructuralPartialEq forAddrParseError
implStructuralPartialEq forIpv4Addr
implStructuralPartialEq forIpv6Addr
implStructuralPartialEq forSocketAddrV4
implStructuralPartialEq forSocketAddrV6
implStructuralPartialEq forParseFloatError
implStructuralPartialEq forParseIntError
implStructuralPartialEq forTryFromIntError
implStructuralPartialEq forRangeFull
implStructuralPartialEq forUCred
implStructuralPartialEq forInvalidHandleError
implStructuralPartialEq forNullHandleError
implStructuralPartialEq forNormalizeError
implStructuralPartialEq forStripPrefixError
implStructuralPartialEq forExitCode
implStructuralPartialEq forExitStatus
implStructuralPartialEq forExitStatusError
implStructuralPartialEq forOutput
implStructuralPartialEq for std::ptr::Alignment
implStructuralPartialEq forParseBoolError
implStructuralPartialEq forUtf8Error
implStructuralPartialEq forFromUtf8Error
implStructuralPartialEq forString
implStructuralPartialEq forRecvError
implStructuralPartialEq forWaitTimeoutResult
implStructuralPartialEq forRawWaker
implStructuralPartialEq forRawWakerVTable
implStructuralPartialEq forAccessError
implStructuralPartialEq forThreadId
implStructuralPartialEq forDuration
implStructuralPartialEq forInstant
implStructuralPartialEq forSystemTime
implStructuralPartialEq forTryFromFloatSecsError
implStructuralPartialEq forPhantomPinned
impl<'a>StructuralPartialEq forComponent<'a>
impl<'a>StructuralPartialEq forPrefix<'a>
impl<'a>StructuralPartialEq forUtf8Pattern<'a>
impl<'a>StructuralPartialEq forUtf8Chunk<'a>
impl<'a>StructuralPartialEq forPhantomContravariantLifetime<'a>
impl<'a>StructuralPartialEq forPhantomCovariantLifetime<'a>
impl<'a>StructuralPartialEq forPhantomInvariantLifetime<'a>
impl<B, C>StructuralPartialEq forControlFlow<B, C>
impl<Idx>StructuralPartialEq for std::ops::Range<Idx>
impl<Idx>StructuralPartialEq for std::ops::RangeFrom<Idx>
impl<Idx>StructuralPartialEq for std::ops::RangeInclusive<Idx>
impl<Idx>StructuralPartialEq forRangeTo<Idx>
impl<Idx>StructuralPartialEq for std::ops::RangeToInclusive<Idx>
impl<Idx>StructuralPartialEq for std::range::Range<Idx>
impl<Idx>StructuralPartialEq for std::range::RangeFrom<Idx>
impl<Idx>StructuralPartialEq for std::range::RangeInclusive<Idx>
impl<Idx>StructuralPartialEq for std::range::RangeToInclusive<Idx>
impl<T>StructuralPartialEq forBound<T>
impl<T>StructuralPartialEq forOption<T>
impl<T>StructuralPartialEq forSendTimeoutError<T>
impl<T>StructuralPartialEq forTrySendError<T>
impl<T>StructuralPartialEq forPoll<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.