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

模式匹配中使用的常量的必需 trait。

不管其类型参数是否实现了 Eq,任何派生 PartialEq 的类型都会自动实现这个 trait。

如果 const 项包含某种不实现此 trait 的类型,则该类型要么 (1.) 不实现 PartialEq (这意味着常量将不提供该比较方法 (代码生成假定可用) ),要么 (2.) 自身实现 itsPartialEq 的版本 (我们认为不符合结构相等性比较)。

在以上两种情况中的任何一种情况下,我们都拒绝在模式匹配中使用此类常量。

另请参见 结构匹配 RFCissue 63438,它们促使从基于属性的设计迁移到此 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 Which

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

1.27.0 · source§

impl StructuralPartialEq for CpuidResult

1.69.0 · source§

impl StructuralPartialEq for FromBytesUntilNulError

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

1.57.0 · source§

impl StructuralPartialEq for TryReserveError

1.64.0 · source§

impl StructuralPartialEq for CString

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.0.0 · source§

impl StructuralPartialEq for 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.34.0 · source§

impl StructuralPartialEq for NonZeroI8

1.34.0 · source§

impl StructuralPartialEq for NonZeroI16

1.34.0 · source§

impl StructuralPartialEq for NonZeroI32

1.34.0 · source§

impl StructuralPartialEq for NonZeroI64

1.34.0 · source§

impl StructuralPartialEq for NonZeroI128

1.34.0 · source§

impl StructuralPartialEq for NonZeroIsize

1.28.0 · source§

impl StructuralPartialEq for NonZeroU8

1.28.0 · source§

impl StructuralPartialEq for NonZeroU16

1.28.0 · source§

impl StructuralPartialEq for NonZeroU32

1.28.0 · source§

impl StructuralPartialEq for NonZeroU64

1.28.0 · source§

impl StructuralPartialEq for NonZeroU128

1.28.0 · source§

impl StructuralPartialEq for NonZeroUsize

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

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 Location<'a>

source§

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

1.55.0 · source§

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

1.0.0 · source§

impl<Idx> StructuralPartialEq for 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>

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>

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 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 PhantomData<T>where T: ?Sized,

1.0.0 · source§

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

source§

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