kvarn_async::prelude::compact_str::core::marker

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.

Any type that derives PartialEq automatically implements this trait, regardless of whether its type-parameters implement PartialEq.

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 an attribute-based design to this trait.

Implementors

1.7.0source

impl StructuralPartialEq for IpAddr

1.0.0source

impl StructuralPartialEq for SocketAddr

1.28.0source

impl StructuralPartialEq for kvarn_async::prelude::fmt::Alignment

1.0.0source

impl StructuralPartialEq for ErrorKind

1.0.0source

impl StructuralPartialEq for SeekFrom</