Trait frame_support::storage::types::KeyGenerator[][src]

pub trait KeyGenerator {
    type Key: EncodeLike<Self::Key>;
    type KArg: Encode;
    type HashFn: FnOnce(&[u8]) -> Vec<u8>;
    type HArg;

    const HASHER_METADATA: &'static [StorageHasher];

    fn final_key<KArg: EncodeLikeTuple<Self::KArg> + TupleToEncodedIter>(
        key: KArg
    ) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
;
fn migrate_key<KArg: EncodeLikeTuple<Self::KArg> + TupleToEncodedIter>(
        key: &KArg,
        hash_fns: Self::HArg
    ) -> Vec<u8>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
; }
Expand description

A trait that contains the current key as an associated type.

Associated Types

Associated Constants

Required methods

Given a key tuple, calculate the final key by encoding each element individuallly and hashing them using the corresponding hasher in the KeyGenerator.

Given a key tuple, migrate the keys from using the old hashers as given by hash_fns to using the newer hashers as specified by this KeyGenerator.

Implementations on Foreign Types

Implementors