Enum subxt_metadata::StorageHasher
source · pub enum StorageHasher {
Blake2_128,
Blake2_256,
Blake2_128Concat,
Twox128,
Twox256,
Twox64Concat,
Identity,
}Expand description
Hasher used by storage maps.
Variants§
Blake2_128
128-bit Blake2 hash.
Blake2_256
256-bit Blake2 hash.
Blake2_128Concat
Multiple 128-bit Blake2 hashes concatenated.
Twox128
128-bit XX hash.
Twox256
256-bit XX hash.
Twox64Concat
Multiple 64-bit XX hashes concatenated.
Identity
Identity hashing (no hashing).
Implementations§
source§impl StorageHasher
impl StorageHasher
sourcepub fn len_excluding_key(&self) -> usize
pub fn len_excluding_key(&self) -> usize
The hash produced by a StorageHasher can have these two components, in order:
- A fixed size hash. (not present for
StorageHasher::Identity). - The SCALE encoded key that was used as an input to the hasher (only present for
StorageHasher::Twox64Concat,StorageHasher::Blake2_128ConcatorStorageHasher::Identity).
This function returns the number of bytes used to represent the first of these.
sourcepub fn ends_with_key(&self) -> bool
pub fn ends_with_key(&self) -> bool
Returns true if the key used to produce the hash is appended to the hash itself.
Trait Implementations§
source§impl Clone for StorageHasher
impl Clone for StorageHasher
source§fn clone(&self) -> StorageHasher
fn clone(&self) -> StorageHasher
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for StorageHasher
impl Debug for StorageHasher
impl Copy for StorageHasher
Auto Trait Implementations§
impl Freeze for StorageHasher
impl RefUnwindSafe for StorageHasher
impl Send for StorageHasher
impl Sync for StorageHasher
impl Unpin for StorageHasher
impl UnwindSafe for StorageHasher
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more