Trait fuel_core_storage::blueprint::sparse::PrimaryKey

source ·
pub trait PrimaryKey {
    type InputKey: ?Sized;
    type OutputKey: ?Sized;

    // Required method
    fn primary_key(key: &Self::InputKey) -> &Self::OutputKey;
}
Expand description

The trait that allows to convert the key of the table into the key of the metadata table. If the key comprises several entities, it is possible to build a Merkle tree over different primary keys. The trait defines the key over which to build an SMT.

Required Associated Types§

source

type InputKey: ?Sized

The storage key of the table.

source

type OutputKey: ?Sized

The extracted primary key.

Required Methods§

source

fn primary_key(key: &Self::InputKey) -> &Self::OutputKey

Converts the key of the table into the primary key of the metadata table.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl PrimaryKey for fuel_core_storage::structured_storage::balances::KeyConverter

source§

impl PrimaryKey for fuel_core_storage::structured_storage::state::KeyConverter