[][src]Trait frame_support::storage::generator::StorageValue

pub trait StorageValue<T: FullCodec> {
    type Query;
    fn module_prefix() -> &'static [u8];
fn storage_prefix() -> &'static [u8];
fn from_optional_value_to_query(v: Option<T>) -> Self::Query;
fn from_query_to_optional_value(v: Self::Query) -> Option<T>; fn storage_value_final_key() -> [u8; 32] { ... } }

Generator for StorageValue used by decl_storage.

By default value is stored at:

Twox128(module_prefix) ++ Twox128(storage_prefix)

Associated Types

type Query

The type that get/take returns.

Loading content...

Required methods

Important traits for &'_ mut [u8]
fn module_prefix() -> &'static [u8]

Module prefix. Used for generating final key.

Important traits for &'_ mut [u8]
fn storage_prefix() -> &'static [u8]

Storage prefix. Used for generating final key.

fn from_optional_value_to_query(v: Option<T>) -> Self::Query

Convert an optional value retrieved from storage to the type queried.

fn from_query_to_optional_value(v: Self::Query) -> Option<T>

Convert a query to an optional value into storage.

Loading content...

Provided methods

fn storage_value_final_key() -> [u8; 32]

Generate the full key used in top storage.

Loading content...

Implementors

Loading content...