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 == bimpliesb == a; and - transitive:
a == bandb == cimpliesa == 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 derived, 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) -> Ret1.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, ...) -> Ret1.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) -> Retimpl<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) -> Ret1.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, ...) -> Retimpl<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, ...) -> Ret1.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, ...) -> Ret1.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, ...) -> Ret1.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) -> Ret1.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) -> Retimpl<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) -> Ret1.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, ...) -> Retimpl<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) -> Ret1.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, ...) -> Ret1.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) -> Ret1.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) -> Ret1.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) -> Ret1.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, ...) -> Ret1.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, ...) -> Ret1.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, ...) -> Ret1.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, ...) -> Ret1.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) -> Retimpl<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) -> Ret1.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) -> Ret1.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) -> Retimpl Eq for OptionBoolimpl Eq for Errorimpl Eq for Errorimpl<'t> Eq for Match<'t>impl<'t> Eq for Match<'t>impl Eq for Matchimpl Eq for MatchKindimpl Eq for MatchKindimpl Eq for Hirimpl Eq for ClassUnicodeKindimpl Eq for ClassBytesimpl Eq for ClassSetBinaryOpimpl Eq for RepetitionKindimpl Eq for FlagsItemKindimpl Eq for Errorimpl Eq for AssertionKindimpl Eq for Utf8Rangeimpl Eq for Positionimpl Eq for ErrorKindimpl Eq for RepetitionKindimpl Eq for Commentimpl Eq for ClassSetRangeimpl Eq for Repetitionimpl Eq for ClassUnicodeRangeimpl Eq for Concatimpl Eq for ClassSetBinaryOpKindimpl Eq for LiteralKindimpl Eq for Alternationimpl Eq for HexLiteralKindimpl Eq for Flagimpl Eq for WithCommentsimpl Eq for WordBoundaryimpl Eq for Groupimpl Eq for ClassSetItemimpl Eq for ClassBytesRangeimpl Eq for RepetitionRangeimpl Eq for ErrorKindimpl Eq for ClassUnicodeOpKindimpl Eq for ClassSetimpl Eq for ClassUnicodeimpl Eq for ClassAsciiimpl Eq for Anchorimpl Eq for Repetitionimpl Eq for CaptureNameimpl Eq for Astimpl Eq for Utf8Sequenceimpl Eq for Flagsimpl Eq for Spanimpl Eq for RepetitionRangeimpl Eq for SpecialLiteralKindimpl Eq for ClassPerlimpl Eq for HirKindimpl Eq for RepetitionOpimpl Eq for Literalsimpl Eq for Literalimpl Eq for GroupKindimpl Eq for SetFlagsimpl Eq for Literalimpl Eq for Classimpl Eq for Errorimpl Eq for GroupKindimpl Eq for ClassAsciiKindimpl Eq for ClassUnicodeimpl Eq for Errorimpl Eq for ClassBracketedimpl Eq for ClassPerlKindimpl Eq for FlagsItemimpl Eq for Classimpl Eq for Assertionimpl Eq for ClassSetUnionimpl Eq for Groupimpl Eq for Literalimpl Eq for OnceStateimpl Eq for WaitTimeoutResultimpl Eq for UnparkTokenimpl Eq for FilterOpimpl Eq for ParkTokenimpl Eq for UnparkResultimpl Eq for RequeueOpimpl Eq for ParkResultimpl Eq for BigEndianimpl Eq for LittleEndianimpl<Number, Hash> Eq for ChangesTrieConfigurationRange<Number, Hash> where
Hash: Eq,
Number: Eq, impl Eq for ValueTypeimpl Eq for Signatureimpl Eq for FunctionTypeimpl Eq for BlockTypeimpl Eq for Instructionimpl Eq for Typeimpl Eq for ValueTypeimpl Eq for BrTableDataimpl Eq for StartedWithimpl Eq for Pagesimpl Eq for Wordsimpl Eq for Wordsimpl Eq for Bytesimpl Eq for Pagesimpl Eq for Errnoimpl Eq for Errorimpl Eq for H128impl Eq for U128impl Eq for H256impl Eq for H512impl Eq for U512impl Eq for H160impl Eq for U256impl Eq for vec128_storageimpl Eq for vec512_storageimpl Eq for vec256_storageimpl Eq for FromStrRadixErrKindimpl Eq for ATermimpl Eq for Z0impl Eq for Lessimpl Eq for UTermimpl Eq for B1impl Eq for Greaterimpl Eq for Equalimpl Eq for B0impl Eq for IsNormalizedimpl Eq for InvalidKeyLengthimpl<M> Eq for Output<M> where
M: Mac, impl Eq for MacErrorimpl Eq for PublicKeyimpl Eq for RecoveryIdimpl Eq for Jacobianimpl Eq for Signatureimpl Eq for Affineimpl Eq for Fieldimpl Eq for Messageimpl Eq for AffineStorageimpl Eq for SecretKeyimpl Eq for Scalarimpl Eq for Errorimpl Eq for MacErrorimpl Eq for InvalidKeyLengthimpl Eq for u32x4impl Eq for Errorimpl Eq for MiniSecretKeyimpl Eq for VRFProofimpl Eq for MultiSignatureStageimpl Eq for Commitmentimpl Eq for PublicKeyimpl Eq for SecretKeyimpl Eq for ECQVCertPublicimpl Eq for VRFProofBatchableimpl Eq for VRFOutputimpl Eq for RistrettoBothimpl Eq for SignatureErrorimpl Eq for Cosignatureimpl Eq for ChainCodeimpl Eq for VRFInOutimpl Eq for Revealimpl Eq for Signatureimpl Eq for PublicKeyimpl<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 TryReserveErrorimpl Eq for Blake2bResultimpl Eq for Blake2sResultimpl Eq for PollNextimpl Eq for Abortedimpl Eq for Canceledimpl Eq for SendErrorimpl<'a> Eq for NibbleSlice<'a>impl Eq for NodeHandlePlanimpl Eq for NibbleVecimpl<'a> Eq for Node<'a>impl Eq for NibbleSlicePlanimpl<'a> Eq for NodeHandle<'a>impl Eq for NodePlanimpl<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 DwAteimpl Eq for DwDefaultedimpl<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 Registerimpl Eq for ColumnTypeimpl Eq for DwDscimpl Eq for SectionIdimpl Eq for DwRleimpl Eq for DwChildrenimpl<'bases, Section, R> Eq for CieOrFde<'bases, Section, R> where
R: Eq + Reader,
Section: Eq + UnwindSection<R>, impl Eq for DwCcimpl Eq for DwCfaimpl Eq for Rangeimpl Eq for LineEncodingimpl<R, Offset> Eq for FrameDescriptionEntry<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset, impl Eq for LineRowimpl<R, Offset> Eq for CompleteLineProgram<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset, impl Eq for SectionBaseAddressesimpl Eq for DwOpimpl Eq for RunTimeEndianimpl Eq for DwDsimpl Eq for DwMacroimpl<R, Offset> Eq for AttributeValue<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset, impl Eq for DwAtimpl Eq for DwLnsimpl Eq for FileEntryFormatimpl Eq for BaseAddressesimpl Eq for DwVisimpl Eq for Augmentationimpl Eq for DwOrdimpl<R, Offset> Eq for IncompleteLineProgram<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset, impl Eq for DwLnctimpl Eq for DwIdimpl Eq for Abbreviationimpl Eq for DwFormimpl Eq for DwEndimpl<R, Offset> Eq for CommonInformationEntry<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset, impl Eq for Errorimpl Eq for DwTagimpl Eq for DwIdximpl Eq for DwLleimpl Eq for BigEndianimpl Eq for Pointerimpl Eq for Encodingimpl Eq for DwLangimpl Eq for ValueTypeimpl<R, Offset> Eq for UnitHeader<R, Offset> where
R: Eq + Reader<Offset = Offset>,
Offset: Eq + ReaderOffset, impl Eq for DwAddrimpl Eq for DwEhPeimpl Eq for DwInlimpl Eq for DebugTypeSignatureimpl Eq for Formatimpl Eq for AttributeSpecificationimpl Eq for DwAccessimpl Eq for LittleEndianimpl Eq for ReaderOffsetIdimpl Eq for DwarfFileTypeimpl Eq for DwoIdimpl Eq for DwVirtualityimpl Eq for DwLneimpl Eq for DwUtimpl<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 ArchiveKindimpl Eq for LittleEndianimpl Eq for Endiannessimpl Eq for RelocationEncodingimpl Eq for BinaryFormatimpl Eq for Errorimpl<'data> Eq for CompressedData<'data>impl Eq for SymbolScopeimpl Eq for SymbolSectionimpl Eq for CompressionFormatimpl<'data> Eq for ObjectMapEntry<'data>impl Eq for ComdatKindimpl Eq for SymbolIndeximpl Eq for AddressSizeimpl Eq for SectionFlagsimpl Eq for SectionKindimpl<'data> Eq for Bytes<'data>impl Eq for Architectureimpl Eq for FileFlagsimpl Eq for SymbolKindimpl Eq for SectionIndeximpl Eq for BigEndianimpl Eq for RelocationTargetimpl Eq for RelocationKindimpl Eq for TINFLStatusimpl Eq for MZStatusimpl Eq for CompressionStrategyimpl Eq for TDEFLFlushimpl Eq for TDEFLStatusimpl Eq for MZFlushimpl Eq for DataFormatimpl Eq for CompressionLevelimpl Eq for StreamResultimpl Eq for MZErrorimpl<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>