Trait StorageValue

Source
pub trait StorageValue {
    type VALUE: Decode;

    const PALLET_NAME: &'static str;
    const STORAGE_NAME: &'static str;

    // Provided methods
    fn encode_storage_key() -> [u8; 32] { ... }
    fn hex_encode_storage_key() -> String { ... }
    fn decode(value: &mut &[u8]) -> Result<Self::VALUE, Error> { ... }
    fn fetch(
        client: &RpcClient,
        at: Option<H256>,
    ) -> impl Future<Output = Result<Option<Self::VALUE>, Error>> { ... }
}

Required Associated Constants§

Source

const PALLET_NAME: &'static str

Source

const STORAGE_NAME: &'static str

Required Associated Types§

Provided Methods§

Source

fn encode_storage_key() -> [u8; 32]

Source

fn hex_encode_storage_key() -> String

Source

fn decode(value: &mut &[u8]) -> Result<Self::VALUE, Error>

Source

fn fetch( client: &RpcClient, at: Option<H256>, ) -> impl Future<Output = Result<Option<Self::VALUE>, Error>>

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§