fuel_core_storage::blueprint::sparse

Trait 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.

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§