pub trait Hash {
// Required method
fn hash<H>(&self, state: &mut H)
where H: Hasher;
// Provided method
fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher,
Self: Sized { ... }
}
Expand description
A hashable type.
Types implementing Hash
are able to be hash
ed with an instance of
Hasher
.
§Implementing Hash
You can derive Hash
with #[derive(Hash)]
if all fields implement Hash
.
The resulting hash will be the combination of the values from calling
hash
on each field.
#[derive(Hash)]
struct Rustacean {
name: String,
country: String,
}
If you need more control over how a value is hashed, you can of course
implement the Hash
trait yourself:
use std::hash::{Hash, Hasher};
struct Person {
id: u32,
name: String,
phone: u64,
}
impl Hash for Person {
fn hash<H: Hasher>(&self, state: &mut H) {
self.id.hash(state);
self.phone.hash(state);
}
}
§Hash
and Eq
When implementing both Hash
and Eq
, it is important that the following
property holds:
k1 == k2 -> hash(k1) == hash(k2)
In other words, if two keys are equal, their hashes must also be equal.
HashMap
and HashSet
both rely on this behavior.
Thankfully, you won’t need to worry about upholding this property when
deriving both Eq
and Hash
with #[derive(PartialEq, Eq, Hash)]
.
Violating this property is a logic error. The behavior resulting from a logic error is not
specified, but users of the trait must ensure that such logic errors do not result in
undefined behavior. This means that unsafe
code must not rely on the correctness of these
methods.
§Prefix collisions
Implementations of hash
should ensure that the data they
pass to the Hasher
are prefix-free. That is,
values which are not equal should cause two different sequences of values to be written,
and neither of the two sequences should be a prefix of the other.
For example, the standard implementation of Hash
for &str
passes an extra
0xFF
byte to the Hasher
so that the values ("ab", "c")
and ("a", "bc")
hash differently.
§Portability
Due to differences in endianness and type sizes, data fed by Hash
to a Hasher
should not be considered portable across platforms. Additionally the data passed by most
standard library types should not be considered stable between compiler versions.
This means tests shouldn’t probe hard-coded hash values or data fed to a Hasher
and
instead should check consistency with Eq
.
Serialization formats intended to be portable between platforms or compiler versions should
either avoid encoding hashes or only rely on Hash
and Hasher
implementations that
provide additional guarantees.
Required Methods§
Provided Methods§
1.3.0 · Sourcefn hash_slice<H>(data: &[Self], state: &mut H)
fn hash_slice<H>(data: &[Self], state: &mut H)
Feeds a slice of this type into the given Hasher
.
This method is meant as a convenience, but its implementation is
also explicitly left unspecified. It isn’t guaranteed to be
equivalent to repeated calls of hash
and implementations of
Hash
should keep that in mind and call hash
themselves
if the slice isn’t treated as a whole unit in the PartialEq
implementation.
For example, a VecDeque
implementation might naïvely call
as_slices
and then hash_slice
on each slice, but this
is wrong since the two slices can change with a call to
make_contiguous
without affecting the PartialEq
result. Since these slices aren’t treated as singular
units, and instead part of a larger deque, this method cannot
be used.
§Examples
use std::hash::{DefaultHasher, Hash, Hasher};
let mut hasher = DefaultHasher::new();
let numbers = [6, 28, 496, 8128];
Hash::hash_slice(&numbers, &mut hasher);
println!("Hash is {:x}!", hasher.finish());
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Hash for CreationStrategy
impl Hash for AccessControllerPartitionOffset
impl Hash for AccessRule
impl Hash for AccountLockerPartitionOffset
impl Hash for AccountPartitionOffset
impl Hash for AlwaysVisibleGlobalNodesVersion
impl Hash for AttachedModuleId
impl Hash for AuthZoneField
impl Hash for BasicRequirement
impl Hash for BlueprintPayloadDef
impl Hash for BootLoaderField
impl Hash for ComponentField
impl Hash for ComponentRoyaltyPartitionOffset
impl Hash for CompositeRequirement
impl Hash for ConsensusManagerCollection
impl Hash for ConsensusManagerFeature
impl Hash for ConsensusManagerField
impl Hash for ConsensusManagerPartitionOffset
impl Hash for CurveType
impl Hash for DatabaseUpdate
impl Hash for DefaultDepositRule
impl Hash for Emitter
impl Hash for EntityType
impl Hash for FungibleBucketField
impl Hash for FungibleProofField
impl Hash for FungibleResourceManagerCollection
impl Hash for FungibleResourceManagerFeature
impl Hash for FungibleResourceManagerField
impl Hash for FungibleResourceManagerPartitionOffset
impl Hash for FungibleVaultCollection
impl Hash for FungibleVaultFeature
impl Hash for FungibleVaultField
impl Hash for FungibleVaultPartitionOffset
impl Hash for GenericSubstitution
impl Hash for IdentityV1MinorVersion
impl Hash for IntentHash
impl Hash for LocalRef
impl Hash for LocalTypeId
impl Hash for ManifestAddress
impl Hash for ManifestBucketBatch
impl Hash for ManifestComponentAddress
impl Hash for ManifestExpression
impl Hash for ManifestGlobalAddress
impl Hash for ManifestNonFungibleLocalId
impl Hash for ManifestPackageAddress
impl Hash for ManifestProofBatch
impl Hash for ManifestResourceAddress
impl Hash for ManifestResourceOrNonFungible
impl Hash for MetadataPartitionOffset
impl Hash for MethodAccessibility
impl Hash for ModuleId
impl Hash for MultiResourcePoolPartitionOffset
impl Hash for NonFungibleBucketField
impl Hash for NonFungibleIdType
impl Hash for NonFungibleLocalId
impl Hash for NonFungibleProofField
impl Hash for NonFungibleResourceManagerCollection
impl Hash for NonFungibleResourceManagerFeature
impl Hash for NonFungibleResourceManagerField
impl Hash for NonFungibleResourceManagerGeneric
impl Hash for NonFungibleResourceManagerPartitionOffset
impl Hash for NonFungibleVaultCollection
impl Hash for NonFungibleVaultFeature
impl Hash for NonFungibleVaultField
impl Hash for NonFungibleVaultPartitionOffset
impl Hash for OneResourcePoolPartitionOffset
impl Hash for OwnerRole
impl Hash for OwnerRoleUpdater
impl Hash for PackageCollection
impl Hash for PackageFeature
impl Hash for PackageField
impl Hash for PackagePartitionOffset
impl Hash for PackageV1MinorVersion
impl Hash for ParseError
impl Hash for PartitionDescription
impl Hash for Proposer
impl Hash for ProtocolUpdateStatusField
impl Hash for ProtocolVersion
impl Hash for scrypto_test::prelude::PublicKey
impl Hash for PublicKeyHash
impl Hash for ResourceFeature
impl Hash for ResourceOrNonFungible
impl Hash for ResourcePreference
impl Hash for Role
impl Hash for RoleAssignmentPartitionOffset
impl Hash for RoyaltyField
impl Hash for RoyaltyRecipient
impl Hash for RustTypeId
impl Hash for SignatureV1
impl Hash for SignatureWithPublicKeyV1
impl Hash for scrypto_test::prelude::StorageType
impl Hash for SubstateKey
impl Hash for TransactionProcessorV1MinorVersion
impl Hash for TransactionTrackerField
impl Hash for TwoResourcePoolPartitionOffset
impl Hash for TypeInfoField
impl Hash for ValidatorCollection
impl Hash for ValidatorFeature
impl Hash for ValidatorField
impl Hash for ValidatorPartitionOffset
impl Hash for WorktopField
impl Hash for PoolV1MinorVersion
impl Hash for MultiResourcePoolCollection
impl Hash for MultiResourcePoolFeature
impl Hash for MultiResourcePoolField
impl Hash for OneResourcePoolCollection
impl Hash for OneResourcePoolFeature
impl Hash for OneResourcePoolField
impl Hash for TwoResourcePoolCollection
impl Hash for TwoResourcePoolFeature
impl Hash for TwoResourcePoolField
impl Hash for AccessControllerCollection
impl Hash for AccessControllerFeature
impl Hash for AccessControllerField
impl Hash for AccessControllerV2Collection
impl Hash for AccessControllerV2Feature
impl Hash for AccessControllerV2Field
impl Hash for scrypto_test::prelude::rust::cmp::Ordering
impl Hash for Infallible
impl Hash for scrypto_test::prelude::rust::sync::atomic::Ordering
impl Hash for AsciiChar
impl Hash for IpAddr
impl Hash for Ipv6MulticastScope
impl Hash for SocketAddr
impl Hash for std::io::error::ErrorKind
impl Hash for AnsiColor
impl Hash for Color
impl Hash for bech32::Error
impl Hash for bech32::Variant
impl Hash for BLST_ERROR
impl Hash for Edition
impl Hash for MaintenanceStatus
impl Hash for Resolver
impl Hash for fsconfig_command
impl Hash for membarrier_cmd
impl Hash for membarrier_cmd_flag
impl Hash for procmap_query_flags
impl Hash for Sign
impl Hash for BlueprintHook
impl Hash for AccountCollection
impl Hash for AccountFeature
impl Hash for AccountField
impl Hash for AccountLockerCollection
impl Hash for AccountLockerFeature
impl Hash for AccountLockerField
impl Hash for MetadataCollection
impl Hash for MetadataFeature
impl Hash for MetadataField
impl Hash for RoleAssignmentCollection
impl Hash for RoleAssignmentFeature
impl Hash for RoleAssignmentField
impl Hash for ComponentRoyaltyCollection
impl Hash for ComponentRoyaltyFeature
impl Hash for ComponentRoyaltyField
impl Hash for StaleTreePart
impl Hash for TreeNodeV1
impl Hash for TreeNodeVersions
impl Hash for StateTreeValidationError
impl Hash for ChangeSource
impl Hash for ConstExprKind
impl Hash for radix_wasm_instrument::utils::translator::Item
impl Hash for Direction
impl Hash for ComponentCastError
impl Hash for ObjectStubHandle
impl Hash for ModuleHandle
impl Hash for Mutability
impl Hash for All
impl Hash for SignOnly
impl Hash for VerifyOnly
impl Hash for ElligatorSwiftParty
impl Hash for secp256k1::Error
impl Hash for Parity
impl Hash for Op
impl Hash for Value
impl Hash for AttrStyle
impl Hash for Meta
impl Hash for NestedMeta
impl Hash for Fields
impl Hash for Visibility
impl Hash for syn::derive::Data
impl Hash for Expr
impl Hash for GenericMethodArgument
impl Hash for Member
impl Hash for RangeLimits
impl Hash for GenericParam
impl Hash for TraitBoundModifier
impl Hash for TypeParamBound
impl Hash for WherePredicate
impl Hash for FnArg
impl Hash for ForeignItem
impl Hash for ImplItem
impl Hash for syn::item::Item
impl Hash for TraitItem
impl Hash for UseTree
impl Hash for Lit
impl Hash for MacroDelimiter
impl Hash for BinOp
impl Hash for UnOp
impl Hash for Pat
impl Hash for GenericArgument
impl Hash for PathArguments
impl Hash for Stmt
impl Hash for ReturnType
impl Hash for syn::ty::Type
impl Hash for ComponentTypeRef
impl Hash for TypeBounds
impl Hash for ComponentValType
impl Hash for PrimitiveValType
impl Hash for wasm_encoder::core::types::HeapType
impl Hash for wasm_encoder::core::types::StorageType
impl Hash for wasm_encoder::core::types::ValType
impl Hash for Feature
impl Hash for wasmi_core::value::ValType
impl Hash for wasmparser_nostd::readers::core::types::ValType
impl Hash for wasmparser::readers::core::types::HeapType
impl Hash for wasmparser::readers::core::types::StorageType
impl Hash for wasmparser::readers::core::types::ValType
impl Hash for KebabNameKind<'_>
impl Hash for winnow::error::ErrorKind
impl Hash for bool
impl Hash for char
impl Hash for i8
impl Hash for i16
impl Hash for i32
impl Hash for i64
impl Hash for i128
impl Hash for isize
impl Hash for !
impl Hash for str
impl Hash for u8
impl Hash for u16
impl Hash for u32
impl Hash for u64
impl Hash for u128
impl Hash for ()
impl Hash for usize
impl Hash for OwnedNodeId
impl Hash for ReferencedNodeId
impl Hash for scrypto_test::prelude::fmt::Error
impl Hash for MultiResourcePoolFeatureSet
impl Hash for OneResourcePoolFeatureSet
impl Hash for TwoResourcePoolFeatureSet
impl Hash for Bls12381G1PublicKey
impl Hash for Bls12381G2Signature
impl Hash for BlueprintId
impl Hash for BlueprintTypeIdentifier
impl Hash for BlueprintVersion
impl Hash for BlueprintVersionKey
impl Hash for Bucket
impl Hash for BytesNonFungibleLocalId
impl Hash for CanonicalBlueprintId
impl Hash for ChildSubintentSpecifier
impl Hash for CodeHash
impl Hash for ComponentAddress
impl Hash for ConsensusManagerFeatureSet
impl Hash for ConsensusManagerRegisteredValidatorByStakeKeyPayload
impl Hash for DbPartitionKey
impl Hash for DbSortKey
impl Hash for Decimal
impl Hash for Ed25519PublicKey
impl Hash for Ed25519PublicKeyHash
impl Hash for Ed25519Signature
impl Hash for EnabledModules
impl Hash for Epoch
impl Hash for EventFlags
impl Hash for EventTypeIdentifier
impl Hash for scrypto_test::prelude::FieldValue
impl Hash for FlashTransactionHash
impl Hash for FungibleBucket
impl Hash for FungibleProof
impl Hash for FungibleResourceManagerFeatureSet
impl Hash for FungibleVault
impl Hash for FungibleVaultFeatureSet
impl Hash for GlobalAddress
impl Hash for GlobalAddressReservation
impl Hash for Hash
impl Hash for I192
impl Hash for I256
impl Hash for I320
impl Hash for I384
impl Hash for I448
impl Hash for I512
impl Hash for I768
impl Hash for scrypto_test::prelude::Instant
impl Hash for IntegerNonFungibleLocalId
impl Hash for InternalAddress
impl Hash for LedgerTransactionHash
impl Hash for LockFlags
impl Hash for ManifestAddressReservation
impl Hash for ManifestBlobRef
impl Hash for ManifestBucket
impl Hash for ManifestDecimal
impl Hash for ManifestNamedAddress
impl Hash for ManifestNamedIntent
impl Hash for ManifestNamedIntentIndex
impl Hash for ManifestPreciseDecimal
impl Hash for ManifestProof
impl Hash for MethodKey
impl Hash for ModuleRoleKey
impl Hash for NodeId
impl Hash for NonFungibleBucket
impl Hash for NonFungibleGlobalId
impl Hash for NonFungibleProof
impl Hash for NonFungibleResourceManagerDataKeyPayload
impl Hash for NonFungibleResourceManagerFeatureSet
impl Hash for NonFungibleVault
impl Hash for NonFungibleVaultFeatureSet
impl Hash for NonFungibleVaultNonFungibleKeyPayload
impl Hash for NotarizedTransactionHash
impl Hash for Own
impl Hash for OwnerRoleEntry
impl Hash for PackageAddress
impl Hash for PackageBlueprintVersionAuthConfigKeyPayload
impl Hash for PackageBlueprintVersionDefinitionKeyPayload
impl Hash for PackageBlueprintVersionDependenciesKeyPayload
impl Hash for PackageBlueprintVersionRoyaltyConfigKeyPayload
impl Hash for PackageCodeInstrumentedCodeKeyPayload
impl Hash for PackageCodeOriginalCodeKeyPayload
impl Hash for PackageCodeVmTypeKeyPayload
impl Hash for PackageFeatureSet
impl Hash for PackageSchemaKeyPayload
impl Hash for PartitionNumber
impl Hash for PartitionOffset
impl Hash for PreciseDecimal
impl Hash for Proof
impl Hash for PublicKeyFingerprint
impl Hash for RUIDNonFungibleLocalId
impl Hash for RawFlashTransaction
impl Hash for RawLedgerTransaction
impl Hash for RawNotarizedTransaction
impl Hash for RawPartialTransaction
impl Hash for RawPreviewTransaction
impl Hash for RawRoundUpdateTransactionV1
impl Hash for RawSignedPartialTransaction
impl Hash for RawSignedTransactionIntent
impl Hash for RawSubintent
impl Hash for RawSystemTransaction
impl Hash for RawTransactionIntent
impl Hash for Reference
impl Hash for ResourceAddress
impl Hash for RoleKey
impl Hash for RoleList
impl Hash for Round
impl Hash for RoundUpdateTransactionHash
impl Hash for SchemaHash
impl Hash for ScopedTypeId
impl Hash for Secp256k1PublicKey
impl Hash for Secp256k1PublicKeyHash
impl Hash for Secp256k1Signature
impl Hash for Secp256k1UncompressedPublicKey
impl Hash for SignedTransactionIntentHash
impl Hash for String
impl Hash for StringNonFungibleLocalId
impl Hash for SubintentHash
impl Hash for SystemTransactionHash
impl Hash for TransactionIntentHash
impl Hash for U192
impl Hash for U256
impl Hash for U320
impl Hash for U384
impl Hash for U448
impl Hash for U512
impl Hash for U768
impl Hash for UtcDateTime
impl Hash for ValidatorFeatureSet
impl Hash for Vault
impl Hash for VaultFreezeFlags
impl Hash for WellKnownTypeId
impl Hash for AccessControllerFeatureSet
impl Hash for AccessControllerV2FeatureSet
impl Hash for Layout
impl Hash for PhantomPinned
impl Hash for RangeFull
impl Hash for Alignment
impl Hash for ByteString
impl Hash for CString
impl Hash for core::any::TypeId
impl Hash for ByteStr
impl Hash for CStr
impl Hash for Ipv4Addr
impl Hash for Ipv6Addr
impl Hash for SocketAddrV4
impl Hash for SocketAddrV6
impl Hash for Duration
impl Hash for OsStr
impl Hash for OsString
impl Hash for FileType
impl Hash for UCred
impl Hash for std::path::Path
impl Hash for PathBuf
impl Hash for PrefixComponent<'_>
impl Hash for ThreadId
impl Hash for std::time::Instant
impl Hash for SystemTime
impl Hash for Ansi256Color
impl Hash for RgbColor
impl Hash for Effects
impl Hash for Reset
impl Hash for Style
impl Hash for u5
impl Hash for CompressedEdwardsY
impl Hash for MontgomeryPoint
impl Hash for CompressedRistretto
impl Hash for curve25519_dalek::scalar::Scalar
impl Hash for CxxString
impl Hash for VerifyingKey
impl Hash for multi_stash::Key
impl Hash for BigInt
impl Hash for BigUint
impl Hash for LineColumn
impl Hash for Ident
impl Hash for RefTypes
impl Hash for AccountAuthorizedDepositorKeyPayload
impl Hash for AccountFeatureSet
impl Hash for AccountResourcePreferenceKeyPayload
impl Hash for AccountResourceVaultKeyPayload
impl Hash for AddAuthorizedDepositorEvent
impl Hash for RemoveAuthorizedDepositorEvent
impl Hash for RemoveResourcePreferenceEvent
impl Hash for SetDefaultDepositRuleEvent
impl Hash for SetResourcePreferenceEvent
impl Hash for AccountLockerAccountClaimsKeyPayload
impl Hash for AccountLockerFeatureSet
impl Hash for MetadataEntryKeyPayload
impl Hash for MetadataFeatureSet
impl Hash for RoleAssignmentAccessRuleKeyPayload
impl Hash for RoleAssignmentFeatureSet
impl Hash for ComponentRoyaltyFeatureSet
impl Hash for ComponentRoyaltyMethodAmountKeyPayload
impl Hash for StoredTreeNodeKey
impl Hash for TreeChildEntry
impl Hash for TreeInternalNode
impl Hash for TreeLeafNode
impl Hash for VersionedTreeNode
impl Hash for Nibble
impl Hash for NibblePath
impl Hash for TreeNodeKey
impl Hash for RawManifest
impl Hash for Transition
impl Hash for NonMaxUsize
impl Hash for PatternID
impl Hash for SmallIndex
impl Hash for StateID
impl Hash for HalfMatch
impl Hash for regex_automata::util::search::Match
impl Hash for Span
impl Hash for CreateFlags
impl Hash for ReadFlags
impl Hash for WatchFlags
impl Hash for Access
impl Hash for AtFlags
impl Hash for FallocateFlags
impl Hash for MemfdFlags
impl Hash for Mode
impl Hash for OFlags
impl Hash for RenameFlags
impl Hash for ResolveFlags
impl Hash for SealFlags
impl Hash for StatVfsMountFlags
impl Hash for Errno
impl Hash for DupFlags
impl Hash for FdFlags
impl Hash for ReadWriteFlags
impl Hash for IFlags
impl Hash for StatxAttributes
impl Hash for StatxFlags
impl Hash for XattrFlags
impl Hash for Gid
impl Hash for Uid
impl Hash for Handle
impl Hash for AnyComponent
impl Hash for Metadata
impl Hash for RoleAssignment
impl Hash for Royalty
impl Hash for CheckedFungibleProof
impl Hash for CheckedNonFungibleProof
impl Hash for CheckedProof
impl Hash for FungibleResourceManager
impl Hash for NonFungibleResourceManager
impl Hash for ResourceManager
impl Hash for secp256k1_sys::recovery::RecoverableSignature
impl Hash for secp256k1_sys::ElligatorSwift
impl Hash for secp256k1_sys::Keypair
impl Hash for secp256k1_sys::PublicKey
impl Hash for secp256k1_sys::Signature
impl Hash for secp256k1_sys::XOnlyPublicKey
impl Hash for secp256k1::ecdsa::recovery::RecoverableSignature
impl Hash for SerializedSignature
impl Hash for secp256k1::ecdsa::Signature
impl Hash for secp256k1::ellswift::ElligatorSwift
impl Hash for InvalidParityValue
impl Hash for secp256k1::key::Keypair
impl Hash for secp256k1::key::PublicKey
impl Hash for secp256k1::key::XOnlyPublicKey
impl Hash for OutOfRangeError
impl Hash for secp256k1::scalar::Scalar
impl Hash for secp256k1::schnorr::Signature
impl Hash for Message
impl Hash for BuildMetadata
impl Hash for Comparator
impl Hash for Prerelease
impl Hash for Version
impl Hash for VersionReq
impl Hash for Map<String, Value>
impl Hash for Number
impl Hash for Attribute
impl Hash for MetaList
impl Hash for MetaNameValue
impl Hash for Field
impl Hash for FieldsNamed
impl Hash for FieldsUnnamed
impl Hash for syn::data::Variant
impl Hash for VisCrate
impl Hash for VisPublic
impl Hash for VisRestricted
impl Hash for DataEnum
impl Hash for DataStruct
impl Hash for DataUnion
impl Hash for DeriveInput
impl Hash for Arm
impl Hash for ExprArray
impl Hash for ExprAssign
impl Hash for ExprAssignOp
impl Hash for ExprAsync
impl Hash for ExprAwait
impl Hash for ExprBinary
impl Hash for ExprBlock
impl Hash for ExprBox
impl Hash for ExprBreak
impl Hash for ExprCall
impl Hash for ExprCast
impl Hash for ExprClosure
impl Hash for ExprContinue
impl Hash for ExprField
impl Hash for ExprForLoop
impl Hash for ExprGroup
impl Hash for ExprIf
impl Hash for ExprIndex
impl Hash for ExprLet
impl Hash for ExprLit
impl Hash for ExprLoop
impl Hash for ExprMacro
impl Hash for ExprMatch
impl Hash for ExprMethodCall
impl Hash for ExprParen
impl Hash for ExprPath
impl Hash for ExprRange
impl Hash for ExprReference
impl Hash for ExprRepeat
impl Hash for ExprReturn
impl Hash for ExprStruct
impl Hash for ExprTry
impl Hash for ExprTryBlock
impl Hash for ExprTuple
impl Hash for ExprType
impl Hash for ExprUnary
impl Hash for ExprUnsafe
impl Hash for ExprWhile
impl Hash for ExprYield
impl Hash for syn::expr::FieldValue
impl Hash for Index
impl Hash for Label
impl Hash for MethodTurbofish
impl Hash for File
impl Hash for BoundLifetimes
impl Hash for ConstParam
impl Hash for Generics
impl Hash for LifetimeDef
impl Hash for PredicateEq
impl Hash for PredicateLifetime
impl Hash for PredicateType
impl Hash for TraitBound
impl Hash for TypeParam
impl Hash for WhereClause
impl Hash for ForeignItemFn
impl Hash for ForeignItemMacro
impl Hash for ForeignItemStatic
impl Hash for ForeignItemType
impl Hash for ImplItemConst
impl Hash for ImplItemMacro
impl Hash for ImplItemMethod
impl Hash for ImplItemType
impl Hash for ItemConst
impl Hash for ItemEnum
impl Hash for ItemExternCrate
impl Hash for ItemFn
impl Hash for ItemForeignMod
impl Hash for ItemImpl
impl Hash for ItemMacro2
impl Hash for ItemMacro
impl Hash for ItemMod
impl Hash for ItemStatic
impl Hash for ItemStruct
impl Hash for ItemTrait
impl Hash for ItemTraitAlias
impl Hash for ItemType
impl Hash for ItemUnion
impl Hash for ItemUse
impl Hash for Receiver
impl Hash for syn::item::Signature
impl Hash for TraitItemConst
impl Hash for TraitItemMacro
impl Hash for TraitItemMethod
impl Hash for TraitItemType
impl Hash for UseGlob
impl Hash for UseGroup
impl Hash for UseName
impl Hash for UsePath
impl Hash for UseRename
impl Hash for Lifetime
impl Hash for LitBool
impl Hash for LitByte
impl Hash for LitByteStr
impl Hash for LitChar
impl Hash for LitFloat
impl Hash for LitInt
impl Hash for LitStr
impl Hash for syn::mac::Macro
impl Hash for Nothing
impl Hash for FieldPat
impl Hash for PatBox
impl Hash for PatIdent
impl Hash for PatLit
impl Hash for PatMacro
impl Hash for PatOr
impl Hash for PatPath
impl Hash for PatRange
impl Hash for PatReference
impl Hash for PatRest
impl Hash for PatSlice
impl Hash for PatStruct
impl Hash for PatTuple
impl Hash for PatTupleStruct
impl Hash for PatType
impl Hash for PatWild
impl Hash for AngleBracketedGenericArguments
impl Hash for Binding
impl Hash for Constraint
impl Hash for ParenthesizedGenericArguments
impl Hash for syn::path::Path
impl Hash for PathSegment
impl Hash for QSelf
impl Hash for Block
impl Hash for Local
impl Hash for Abstract
impl Hash for Add
impl Hash for AddEq
impl Hash for And
impl Hash for AndAnd
impl Hash for AndEq
impl Hash for As
impl Hash for Async
impl Hash for At
impl Hash for Auto
impl Hash for Await
impl Hash for Bang
impl Hash for Become
impl Hash for syn::token::Box
impl Hash for Brace
impl Hash for Bracket
impl Hash for Break
impl Hash for Caret
impl Hash for CaretEq
impl Hash for Colon2
impl Hash for Colon
impl Hash for Comma
impl Hash for Const
impl Hash for Continue
impl Hash for Crate
impl Hash for Default
impl Hash for Div
impl Hash for DivEq
impl Hash for Do
impl Hash for Dollar
impl Hash for Dot2
impl Hash for Dot3
impl Hash for Dot
impl Hash for DotDotEq
impl Hash for Dyn
impl Hash for Else
impl Hash for Enum
impl Hash for Eq
impl Hash for EqEq
impl Hash for Extern
impl Hash for FatArrow
impl Hash for Final
impl Hash for Fn
impl Hash for For
impl Hash for Ge
impl Hash for Group
impl Hash for Gt
impl Hash for If
impl Hash for Impl
impl Hash for In
impl Hash for LArrow
impl Hash for Le
impl Hash for Let
impl Hash for Loop
impl Hash for Lt
impl Hash for syn::token::Macro
impl Hash for syn::token::Match
impl Hash for Mod
impl Hash for Move
impl Hash for MulEq
impl Hash for Mut
impl Hash for Ne
impl Hash for Or
impl Hash for OrEq
impl Hash for OrOr
impl Hash for Override
impl Hash for Paren
impl Hash for Pound
impl Hash for Priv
impl Hash for Pub
impl Hash for Question
impl Hash for RArrow
impl Hash for Ref
impl Hash for Rem
impl Hash for RemEq
impl Hash for Return
impl Hash for SelfType
impl Hash for SelfValue
impl Hash for Semi
impl Hash for Shl
impl Hash for ShlEq
impl Hash for Shr
impl Hash for ShrEq
impl Hash for Star
impl Hash for Static
impl Hash for Struct
impl Hash for Sub
impl Hash for SubEq
impl Hash for Super
impl Hash for Tilde
impl Hash for Trait
impl Hash for Try
impl Hash for syn::token::Type
impl Hash for Typeof
impl Hash for Underscore
impl Hash for Union
impl Hash for Unsafe
impl Hash for Unsized
impl Hash for Use
impl Hash for Virtual
impl Hash for Where
impl Hash for While
impl Hash for Yield
impl Hash for Abi
impl Hash for BareFnArg
impl Hash for TypeArray
impl Hash for TypeBareFn
impl Hash for TypeGroup
impl Hash for TypeImplTrait
impl Hash for TypeInfer
impl Hash for TypeMacro
impl Hash for TypeNever
impl Hash for TypeParen
impl Hash for TypePath
impl Hash for TypePtr
impl Hash for TypeReference
impl Hash for TypeSlice
impl Hash for TypeTraitObject
impl Hash for TypeTuple
impl Hash for Variadic
impl Hash for Null
impl Hash for InternalString
impl Hash for toml_edit::key::Key
impl Hash for TomlError
impl Hash for RawString
impl Hash for Decor
impl Hash for Repr
impl Hash for ATerm
impl Hash for B0
impl Hash for B1
impl Hash for Z0
impl Hash for Equal
impl Hash for Greater
impl Hash for Less
impl Hash for UTerm
impl Hash for uuid::error::Error
impl Hash for Braced
impl Hash for Hyphenated
impl Hash for Simple
impl Hash for Urn
impl Hash for NonNilUuid
impl Hash for Uuid
impl Hash for Timestamp
impl Hash for wasm_encoder::core::globals::GlobalType
impl Hash for wasm_encoder::core::memories::MemoryType
impl Hash for wasm_encoder::core::tables::TableType
impl Hash for wasm_encoder::core::types::RefType
impl Hash for wasmi::func::func_type::FuncType
impl Hash for Sym
impl Hash for wasmi_ir::index::Data
impl Hash for Elem
impl Hash for Func
impl Hash for wasmi_ir::index::FuncType
impl Hash for wasmi_ir::index::Global
impl Hash for Instr
impl Hash for InternalFunc
impl Hash for Memory
impl Hash for Reg
impl Hash for Table
impl Hash for wasmparser_nostd::readers::core::operators::Ieee32
impl Hash for wasmparser_nostd::readers::core::operators::Ieee64
impl Hash for wasmparser_nostd::readers::core::operators::V128
impl Hash for wasmparser_nostd::readers::core::types::FuncType
impl Hash for wasmparser_nostd::readers::core::types::GlobalType
impl Hash for wasmparser_nostd::readers::core::types::MemoryType
impl Hash for wasmparser_nostd::readers::core::types::TableType
impl Hash for wasmparser_nostd::validator::WasmFeatures
impl Hash for wasmparser_nostd::validator::types::KebabStr
impl Hash for wasmparser_nostd::validator::types::KebabString
impl Hash for wasmparser_nostd::validator::types::TypeId
impl Hash for wasmparser::readers::core::operators::Ieee32
impl Hash for wasmparser::readers::core::operators::Ieee64
impl Hash for wasmparser::readers::core::operators::V128
impl Hash for ArrayType
impl Hash for wasmparser::readers::core::types::FuncType
impl Hash for wasmparser::readers::core::types::GlobalType
impl Hash for wasmparser::readers::core::types::MemoryType
impl Hash for wasmparser::readers::core::types::RefType
impl Hash for wasmparser::readers::core::types::TableType
impl Hash for KebabName
impl Hash for wasmparser::validator::names::KebabStr
impl Hash for wasmparser::validator::names::KebabString
impl Hash for wasmparser::validator::WasmFeatures
impl Hash for ResourceId
impl Hash for wasmparser::validator::types::TypeId
impl Hash for BStr
impl Hash for Bytes
impl<'a> Hash for SubstateKeyRef<'a>
impl<'a> Hash for Component<'a>
impl<'a> Hash for Prefix<'a>
impl<'a> Hash for PhantomContravariantLifetime<'a>
impl<'a> Hash for PhantomCovariantLifetime<'a>
impl<'a> Hash for PhantomInvariantLifetime<'a>
impl<'a> Hash for Location<'a>
impl<'a> Hash for ImplGenerics<'a>
impl<'a> Hash for Turbofish<'a>
impl<'a> Hash for TypeGenerics<'a>
impl<'a> Hash for wasmparser_nostd::binary_reader::BinaryReader<'a>
impl<'a> Hash for wasmparser::binary_reader::BinaryReader<'a>
impl<'buf> Hash for AllPreallocated<'buf>
impl<'buf> Hash for SignOnlyPreallocated<'buf>
impl<'buf> Hash for VerifyOnlyPreallocated<'buf>
impl<'k> Hash for KeyMut<'k>
impl<A> Hash for SmallVec<A>
impl<A, B> Hash for EitherOrBoth<A, B>
impl<B> Hash for Cow<'_, B>
impl<B, C> Hash for ControlFlow<B, C>
impl<C> Hash for Owned<C>
impl<Dyn> Hash for DynMetadata<Dyn>where
Dyn: ?Sized,
impl<F> Hash for Fwhere
F: FnPtr,
impl<GuardIdx, EntityIdx> Hash for GuardedEntity<GuardIdx, EntityIdx>
impl<H> Hash for HeaderWithLength<H>where
H: Hash,
impl<H, T> Hash for HeaderSlice<H, T>
impl<H, T> Hash for ThinArc<H, T>
impl<Idx> Hash for scrypto_test::prelude::rust::ops::Range<Idx>where
Idx: Hash,
impl<Idx> Hash for scrypto_test::prelude::rust::ops::RangeFrom<Idx>where
Idx: Hash,
impl<Idx> Hash for scrypto_test::prelude::rust::ops::RangeInclusive<Idx>where
Idx: Hash,
impl<Idx> Hash for RangeTo<Idx>where
Idx: Hash,
impl<Idx> Hash for RangeToInclusive<Idx>where
Idx: Hash,
impl<Idx> Hash for core::range::Range<Idx>where
Idx: Hash,
impl<Idx> Hash for core::range::RangeFrom<Idx>where
Idx: Hash,
impl<Idx> Hash for core::range::RangeInclusive<Idx>where
Idx: Hash,
impl<K, V> Hash for scrypto_test::prelude::indexmap::map::Slice<K, V>
impl<K, V, A> Hash for BTreeMap<K, V, A>
impl<L, R> Hash for Either<L, R>
impl<O> Hash for scrypto::component::component::Global<O>where
O: HasStub,
impl<Ptr> Hash for Pin<Ptr>
impl<Storage> Hash for __BindgenBitfieldUnit<Storage>where
Storage: Hash,
impl<T> Hash for Option<T>where
T: Hash,
impl<T> Hash for Bound<T>where
T: Hash,
impl<T> Hash for Poll<T>where
T: Hash,
impl<T> Hash for *const Twhere
T: ?Sized,
impl<T> Hash for *mut Twhere
T: ?Sized,
impl<T> Hash for &T
impl<T> Hash for &mut T
impl<T> Hash for [T]where
T: Hash,
impl<T> Hash for (T₁, T₂, …, Tₙ)
This trait is implemented for tuples up to twelve items long.
impl<T> Hash for scrypto_test::prelude::indexmap::set::Slice<T>where
T: Hash,
impl<T> Hash for Discriminant<T>
impl<T> Hash for ManuallyDrop<T>
impl<T> Hash for BurnRoles<T>where
T: Hash,
impl<T> Hash for DepositRoles<T>where
T: Hash,
impl<T> Hash for FreezeRoles<T>where
T: Hash,
impl<T> Hash for FullyScopedTypeId<T>
impl<T> Hash for MintRoles<T>where
T: Hash,
impl<T> Hash for NonFungibleDataUpdateRoles<T>where
T: Hash,
impl<T> Hash for PhantomData<T>where
T: ?Sized,
impl<T> Hash for RecallRoles<T>where
T: Hash,
impl<T> Hash for WithdrawRoles<T>where
T: Hash,
impl<T> Hash for Reverse<T>where
T: Hash,
impl<T> Hash for PhantomContravariant<T>where
T: ?Sized,
impl<T> Hash for PhantomCovariant<T>where
T: ?Sized,
impl<T> Hash for PhantomInvariant<T>where
T: ?Sized,
impl<T> Hash for NonZero<T>where
T: ZeroablePrimitive + Hash,
impl<T> Hash for Saturating<T>where
T: Hash,
impl<T> Hash for Wrapping<T>where
T: Hash,
impl<T> Hash for NonNull<T>where
T: ?Sized,
impl<T> Hash for CachePadded<T>where
T: Hash,
impl<T> Hash for UniquePtr<T>where
T: Hash + UniquePtrTarget,
impl<T> Hash for MultiStash<T>where
T: Hash,
impl<T> Hash for radix_engine_interface::blueprints::component::Global<T>where
T: TypeInfoMarker,
impl<T> Hash for Spanned<T>where
T: Hash,
impl<T> Hash for Formatted<T>where
T: Hash,
impl<T> Hash for triomphe::arc::Arc<T>
impl<T, A> Hash for scrypto_test::prelude::Arc<T, A>
impl<T, A> Hash for BTreeSet<T, A>
impl<T, A> Hash for scrypto_test::prelude::Box<T, A>
impl<T, A> Hash for LinkedList<T, A>
impl<T, A> Hash for Rc<T, A>
impl<T, A> Hash for Vec<T, A>
The hash of a vector is the same as that of the corresponding slice,
as required by the core::borrow::Borrow
implementation.
use std::hash::BuildHasher;
let b = std::hash::RandomState::new();
let v: Vec<u8> = vec![0xa8, 0x3c, 0x09];
let s: &[u8] = &[0xa8, 0x3c, 0x09];
assert_eq!(b.hash_one(v), b.hash_one(s));
impl<T, A> Hash for VecDeque<T, A>
impl<T, A> Hash for UniqueRc<T, A>
impl<T, A> Hash for UniqueArc<T, A>
impl<T, E> Hash for Result<T, E>
impl<T, N> Hash for GenericArray<T, N>where
T: Hash,
N: ArrayLength<T>,
impl<T, P> Hash for Punctuated<T, P>
impl<T, const CAP: usize> Hash for ArrayVec<T, CAP>where
T: Hash,
impl<T, const N: usize> Hash for [T; N]where
T: Hash,
The hash of an array is the same as that of the corresponding slice,
as required by the Borrow
implementation.
use std::hash::BuildHasher;
let b = std::hash::RandomState::new();
let a: [u8; 3] = [0xa8, 0x3c, 0x09];
let s: &[u8] = &[0xa8, 0x3c, 0x09];
assert_eq!(b.hash_one(a), b.hash_one(s));