Trait frame_support::dispatch::Eq 1.0.0[−][src]
pub trait Eq: PartialEq<Self> { }
Expand description
Trait for equality comparisons which are equivalence relations.
This means, that in addition to a == b
and a != b
being strict inverses, the equality must
be (for all a
, b
and c
):
- reflexive:
a == a
; - symmetric:
a == b
impliesb == a
; and - transitive:
a == b
andb == c
impliesa == c
.
This property cannot be checked by the compiler, and therefore Eq
implies
PartialEq
, and has no extra methods.
Derivable
This trait can be used with #[derive]
. When derive
d, because Eq
has
no extra methods, it is only informing the compiler that this is an
equivalence relation rather than a partial equivalence relation. Note that
the derive
strategy requires all fields are Eq
, which isn’t
always desired.
How can I implement Eq
?
If you cannot use the derive
strategy, specify that your type implements
Eq
, which has no methods:
enum BookFormat { Paperback, Hardback, Ebook } struct Book { isbn: i32, format: BookFormat, } impl PartialEq for Book { fn eq(&self, other: &Self) -> bool { self.isbn == other.isbn } } impl Eq for Book {}
Implementations on Foreign Types
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret
impl<A, B, C, D, E, F, G, H, I, J, K> Eq for (A, B, C, D, E, F, G, H, I, J, K) where
C: Eq,
I: Eq,
A: Eq,
K: Eq + ?Sized,
F: Eq,
E: Eq,
H: Eq,
B: Eq,
D: Eq,
G: Eq,
J: Eq,
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, ...) -> Ret
impl<A, B, C, D, E, F, G, H> Eq for (A, B, C, D, E, F, G, H) where
C: Eq,
A: Eq,
F: Eq,
E: Eq,
H: Eq + ?Sized,
B: Eq,
D: Eq,
G: Eq,
impl<A, B, C, D, E, F, G> Eq for (A, B, C, D, E, F, G) where
C: Eq,
A: Eq,
F: Eq,
E: Eq,
B: Eq,
D: Eq,
G: Eq + ?Sized,
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I) -> Ret
impl<A, B, C, D, E, F, G, H, I> Eq for (A, B, C, D, E, F, G, H, I) where
C: Eq,
I: Eq + ?Sized,
A: Eq,
F: Eq,
E: Eq,
H: Eq,
B: Eq,
D: Eq,
G: Eq,
impl<A, B, C, D, E, F> Eq for (A, B, C, D, E, F) where
C: Eq,
A: Eq,
F: Eq + ?Sized,
E: Eq,
B: Eq,
D: Eq,
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, ...) -> Ret
impl<A, B, C, D, E, F, G, H, I, J, K, L> Eq for (A, B, C, D, E, F, G, H, I, J, K, L) where
C: Eq,
I: Eq,
A: Eq,
K: Eq,
F: Eq,
E: Eq,
H: Eq,
B: Eq,
D: Eq,
G: Eq,
J: Eq,
L: Eq + ?Sized,
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for unsafe fn(A, B, C, D, E, F, G, H, I, J) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H> Eq for extern "C" fn(A, B, C, D, E, F, G, H, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, ...) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret
impl<A, B, C, D, E, F, G, H, I, J> Eq for (A, B, C, D, E, F, G, H, I, J) where
C: Eq,
I: Eq,
A: Eq,
F: Eq,
E: Eq,
H: Eq,
B: Eq,
D: Eq,
G: Eq,
J: Eq + ?Sized,
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K, L> Eq for extern "C" fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H, I, J, K> Eq for fn(A, B, C, D, E, F, G, H, I, J, K) -> Ret
1.4.0[src]
impl<Ret, A, B, C, D, E, F, G, H> Eq for unsafe extern "C" fn(A, B, C, D, E, F, G, H) -> Ret
impl Eq for OptionBool
impl Eq for Error
impl Eq for Error
impl<'t> Eq for Match<'t>
impl<'t> Eq for Match<'t>
impl Eq for Match
impl Eq for MatchKind
impl Eq for MatchKind
impl Eq for Hir
impl Eq for ClassUnicodeKind
impl Eq for ClassBytes
impl Eq for ClassSetBinaryOp
impl Eq for RepetitionKind
impl Eq for FlagsItemKind
impl Eq for Error
impl Eq for AssertionKind
impl Eq for Utf8Range
impl Eq for Position
impl Eq for ErrorKind
impl Eq for RepetitionKind
impl Eq for Comment
impl Eq for ClassSetRange
impl Eq for Repetition
impl Eq for ClassUnicodeRange
impl Eq for Concat
impl Eq for ClassSetBinaryOpKind
impl Eq for LiteralKind
impl Eq for Alternation
impl Eq for HexLiteralKind
impl Eq for Flag
impl Eq for WithComments
impl Eq for WordBoundary
impl Eq for Group
impl Eq for ClassSetItem
impl Eq for ClassBytesRange
impl Eq for RepetitionRange
impl Eq for ErrorKind
impl Eq for ClassUnicodeOpKind
impl Eq for ClassSet
impl Eq for ClassUnicode
impl Eq for ClassAscii
impl Eq for Anchor
impl Eq for Repetition
impl Eq for CaptureName
impl Eq for Ast
impl Eq for Utf8Sequence
impl Eq for Flags
impl Eq for Span
impl Eq for RepetitionRange
impl Eq for SpecialLiteralKind
impl Eq for ClassPerl
impl Eq for HirKind
impl Eq for RepetitionOp
impl Eq for Literals
impl Eq for Literal
impl Eq for GroupKind
impl Eq for SetFlags
impl Eq for Literal
impl Eq for Class
impl Eq for Error
impl Eq for GroupKind
impl Eq for ClassAsciiKind
impl Eq for ClassUnicode
impl Eq for Error
impl Eq for ClassBracketed
impl Eq for ClassPerlKind
impl Eq for FlagsItem
impl Eq for Class
impl Eq for Assertion
impl Eq for ClassSetUnion
impl Eq for Group
impl Eq for Literal
impl Eq for OnceState
impl Eq for WaitTimeoutResult
impl Eq for UnparkToken
impl Eq for FilterOp
impl Eq for ParkToken
impl Eq for UnparkResult
impl Eq for RequeueOp
impl Eq for ParkResult
impl Eq for BigEndian
impl Eq for LittleEndian
impl<Number, Hash> Eq for ChangesTrieConfigurationRange<Number, Hash> where
Hash: Eq,
Number: Eq,
impl Eq for ValueType
impl Eq for Signature
impl Eq for FunctionType
impl Eq for BlockType
impl Eq for Instruction
impl Eq for Type
impl Eq for ValueType
impl Eq for BrTableData
impl Eq for StartedWith
impl Eq for Pages
impl Eq for Words
impl Eq for Words
impl Eq for Bytes
impl Eq for Pages
impl Eq for Errno
impl Eq for Error
impl Eq for H128
impl Eq for U128
impl Eq for H256
impl Eq for H512
impl Eq for U512
impl Eq for H160
impl Eq for U256
impl Eq for vec128_storage
impl Eq for vec512_storage
impl Eq for vec256_storage
impl Eq for FromStrRadixErrKind
impl Eq for ATerm
impl Eq for Z0
impl Eq for Less
impl Eq for UTerm
impl Eq for B1
impl Eq for Greater
impl Eq for Equal
impl Eq for B0
impl Eq for IsNormalized
impl Eq for InvalidKeyLength
impl<M> Eq for Output<M> where
M: Mac,
impl Eq for MacError
impl Eq for PublicKey
impl Eq for RecoveryId
impl Eq for Jacobian
impl Eq for Signature
impl Eq for Affine
impl Eq for Field
impl Eq for Message
impl Eq for AffineStorage
impl Eq for SecretKey
impl Eq for Scalar
impl Eq for Error
impl Eq for MacError
impl Eq for InvalidKeyLength
impl Eq for u32x4
impl Eq for Error
impl Eq for MiniSecretKey
impl Eq for VRFProof
impl Eq for MultiSignatureStage
impl Eq for Commitment
impl Eq for PublicKey
impl Eq for SecretKey
impl Eq for ECQVCertPublic
impl Eq for VRFProofBatchable
impl Eq for VRFOutput
impl Eq for RistrettoBoth
impl Eq for SignatureError
impl Eq for Cosignature
impl Eq for ChainCode
impl Eq for VRFInOut
impl Eq for Reveal
impl Eq for Signature
impl Eq for PublicKey
impl<K, V, S, A> Eq for HashMap<K, V, S, A> where
A: Allocator + Clone,
K: Eq + Hash,
V: Eq,
S: BuildHasher,
impl<T, S, A> Eq for HashSet<T, S, A> where
T: Eq + Hash,
A: Allocator + Clone,
S: BuildHasher,
impl Eq for TryReserveError
impl Eq for Blake2bResult
impl Eq for Blake2sResult
impl Eq for PollNext
impl Eq for Aborted
impl Eq for Canceled
impl Eq for SendError
impl<'a> Eq for NibbleSlice<'a>
impl Eq for NodeHandlePlan
impl Eq for NibbleVec
impl<'a> Eq for Node<'a>
impl Eq for NibbleSlicePlan
impl<'a> Eq for NodeHandle<'a>
impl Eq for NodePlan
impl<H, KF, T, M> Eq for MemoryDB<H, KF, T, M> where
T: Eq + MaybeDebug,
H: Hasher,
M: MemTracker<T> + Eq,
KF: KeyFunction<H>,
<KF as KeyFunction<H>>::Key: Eq,
<KF as KeyFunction<H>>::Key: MaybeDebug,
impl<'bases, Section, R> Eq for PartialFrameDescriptionEntry<'bases, Section, R> where
R: Eq + Reader,
Section: Eq + UnwindSection<R>,
<R as Reader>::Offset: Eq,
<Section as UnwindSection<R>>::Offset: Eq,
impl Eq for DwAte
impl Eq for DwDefaulted
impl<R, Offset> Eq for LineInstruction<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl<R, Offset> Eq for FileEntry<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl<R, Offset> Eq for LineProgramHeader<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for Register
impl Eq for ColumnType
impl Eq for DwDsc
impl Eq for SectionId
impl Eq for DwRle
impl Eq for DwChildren
impl<'bases, Section, R> Eq for CieOrFde<'bases, Section, R> where
R: Eq + Reader,
Section: Eq + UnwindSection<R>,
impl Eq for DwCc
impl Eq for DwCfa
impl Eq for Range
impl Eq for LineEncoding
impl<R, Offset> Eq for FrameDescriptionEntry<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for LineRow
impl<R, Offset> Eq for CompleteLineProgram<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for SectionBaseAddresses
impl Eq for DwOp
impl Eq for RunTimeEndian
impl Eq for DwDs
impl Eq for DwMacro
impl<R, Offset> Eq for AttributeValue<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for DwAt
impl Eq for DwLns
impl Eq for FileEntryFormat
impl Eq for BaseAddresses
impl Eq for DwVis
impl Eq for Augmentation
impl Eq for DwOrd
impl<R, Offset> Eq for IncompleteLineProgram<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for DwLnct
impl Eq for DwId
impl Eq for Abbreviation
impl Eq for DwForm
impl Eq for DwEnd
impl<R, Offset> Eq for CommonInformationEntry<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for Error
impl Eq for DwTag
impl Eq for DwIdx
impl Eq for DwLle
impl Eq for BigEndian
impl Eq for Pointer
impl Eq for Encoding
impl Eq for DwLang
impl Eq for ValueType
impl<R, Offset> Eq for UnitHeader<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl Eq for DwAddr
impl Eq for DwEhPe
impl Eq for DwInl
impl Eq for DebugTypeSignature
impl Eq for Format
impl Eq for AttributeSpecification
impl Eq for DwAccess
impl Eq for LittleEndian
impl Eq for ReaderOffsetId
impl Eq for DwarfFileType
impl Eq for DwoId
impl Eq for DwVirtuality
impl Eq for DwLne
impl Eq for DwUt
impl<R, Offset> Eq for Operation<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset,
impl<'data> Eq for SymbolMapName<'data>
impl<'data> Eq for Export<'data>
impl<'data> Eq for Import<'data>
impl Eq for ArchiveKind
impl Eq for LittleEndian
impl Eq for Endianness
impl Eq for RelocationEncoding
impl Eq for BinaryFormat
impl Eq for Error
impl<'data> Eq for CompressedData<'data>
impl Eq for SymbolScope
impl Eq for SymbolSection
impl Eq for CompressionFormat
impl<'data> Eq for ObjectMapEntry<'data>
impl Eq for ComdatKind
impl Eq for SymbolIndex
impl Eq for AddressSize
impl Eq for SectionFlags
impl Eq for SectionKind
impl<'data> Eq for Bytes<'data>
impl Eq for Architecture
impl Eq for FileFlags
impl Eq for SymbolKind
impl Eq for SectionIndex
impl Eq for BigEndian
impl Eq for RelocationTarget
impl Eq for RelocationKind
impl Eq for TINFLStatus
impl Eq for MZStatus
impl Eq for CompressionStrategy
impl Eq for TDEFLFlush
impl Eq for TDEFLStatus
impl Eq for MZFlush
impl Eq for DataFormat
impl Eq for CompressionLevel
impl Eq for StreamResult
impl Eq for MZError
impl<AccountId, Call, Extra> Eq for CheckedExtrinsic<AccountId, Call, Extra> where
Call: Eq,
AccountId: Eq,
Extra: Eq,
impl<Number, Hash> Eq for Header<Number, Hash> where
Hash: Eq + Hash,
Number: Eq + Copy + Into<U256> + TryFrom<U256>,
<Hash as Hash>::Output: Eq,
impl<AccountId, AccountIndex> Eq for MultiAddress<AccountId, AccountIndex> where
AccountId: Eq,
AccountIndex: Eq,
impl<Info> Eq for DispatchErrorWithPostInfo<Info> where
Info: Eq + PartialEq<Info> + Clone + Copy + Encode + Decode + Printable,
impl<Address, Call, Signature, Extra> Eq for UncheckedExtrinsic<Address, Call, Signature, Extra> where
Call: Eq,
Extra: Eq + SignedExtension,
Address: Eq,
Signature: Eq,
impl<Header, Extrinsic> Eq for Block<Header, Extrinsic> where
Extrinsic: Eq + MaybeSerialize,
Header: Eq,
impl<Reporter, Offender> Eq for OffenceDetails<Reporter, Offender> where
Reporter: Eq,
Offender: Eq,
Implementors
impl<A: Eq + AssetId, B: Eq + Balance, OnDrop: Eq + HandleImbalanceDrop<A, B>, OppositeOnDrop: Eq + HandleImbalanceDrop<A, B>> Eq for frame_support::traits::tokens::fungibles::Imbalance<A, B, OnDrop, OppositeOnDrop>
impl<B, O> Eq for DecodeDifferent<B, O> where
O: Encode + Eq + PartialEq<O> + 'static,
B: Encode + Eq + PartialEq<B> + 'static,
impl<B: Eq + Balance, OnDrop: Eq + HandleImbalanceDrop<B>, OppositeOnDrop: Eq + HandleImbalanceDrop<B>> Eq for frame_support::traits::tokens::fungible::Imbalance<B, OnDrop, OppositeOnDrop>