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

#[lang = "structural_peq"]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.

Implementors

impl StructuralPartialEq for BacktraceStatus[src]

impl StructuralPartialEq for VarError[src]

impl StructuralPartialEq for ErrorKind[src]

impl StructuralPartialEq for SeekFrom[src]

impl StructuralPartialEq for IpAddr[src]

impl StructuralPartialEq for Ipv6MulticastScope[src]

impl StructuralPartialEq for Shutdown[src]

impl StructuralPartialEq for SocketAddr[src]

impl StructuralPartialEq for RecvTimeoutError[src]

impl StructuralPartialEq for TryRecvError[src]

impl StructuralPartialEq for CString[src]

impl StructuralPartialEq for FromBytesWithNulError[src]

impl StructuralPartialEq for FromVecWithNulError[src]

impl StructuralPartialEq for IntoStringError[src]

impl StructuralPartialEq for NulError[src]

impl StructuralPartialEq for FileType[src]

impl StructuralPartialEq for Permissions[src]

impl StructuralPartialEq for AddrParseError[src]

impl StructuralPartialEq for StripPrefixError[src]

impl StructuralPartialEq for ExitStatus[src]

impl StructuralPartialEq for Output[src]

impl StructuralPartialEq for RecvError[src]

impl StructuralPartialEq for WaitTimeoutResult[src]

impl StructuralPartialEq for AccessError[src]

impl StructuralPartialEq for ThreadId[src]

impl StructuralPartialEq for Instant[src]

impl StructuralPartialEq for SystemTime[src]

impl<'a> StructuralPartialEq for Component<'a>[src]

impl<'a> StructuralPartialEq for Prefix<'a>[src]

impl<T> StructuralPartialEq for TrySendError<T>[src]

impl<T> StructuralPartialEq for Cursor<T>[src]

impl<T> StructuralPartialEq for SendError<T>[src]

Loading content...