StorageValue

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_hex_storage_value(value: &str) -> Result<Self::VALUE, Error> { ... }
    fn decode_storage_value(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_hex_storage_value(value: &str) -> Result<Self::VALUE, Error>

Decodes the Hex and SCALE encoded Storage Value This is equal to Hex::decode + Self::decode

If you need to decode bytes call decode

Source

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

Decodes the SCALE encoded Storage Value

If you need to decode Hex string call hex_decode

Source

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

Fetches and decodes a Storage Value

Returns None if no Storage Value is present

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§

Source§

impl StorageValue for NextAppId

Source§

const PALLET_NAME: &'static str = "DataAvailability"

Source§

const STORAGE_NAME: &'static str = "NextAppId"

Source§

type VALUE = Compact<u32>

Source§

impl StorageValue for SubmitDataFeeModifier

Source§

const PALLET_NAME: &'static str = "DataAvailability"

Source§

const STORAGE_NAME: &'static str = "SubmitDataFeeModifier"

Source§

type VALUE = DispatchFeeModifier

Source§

impl StorageValue for Authorities

Source§

const PALLET_NAME: &'static str = "Grandpa"

Source§

const STORAGE_NAME: &'static str = "Authorities"

Source§

type VALUE = Vec<(AuthorityId, u64)>

Source§

impl StorageValue for CurrentSetId

Source§

const PALLET_NAME: &'static str = "Grandpa"

Source§

const STORAGE_NAME: &'static str = "CurrentSetId"

Source§

type VALUE = u64

Source§

impl StorageValue for NextForced

Source§

const PALLET_NAME: &'static str = "Grandpa"

Source§

const STORAGE_NAME: &'static str = "NextForced"

Source§

type VALUE = u32

Source§

impl StorageValue for PendingChange

Source§

const PALLET_NAME: &'static str = "Grandpa"

Source§

const STORAGE_NAME: &'static str = "PendingChange"

Source§

type VALUE = StoredPendingChange

Source§

impl StorageValue for Stalled

Source§

const PALLET_NAME: &'static str = "Grandpa"

Source§

const STORAGE_NAME: &'static str = "Stalled"

Source§

type VALUE = (u32, u32)

Source§

impl StorageValue for StoredState

Source§

const PALLET_NAME: &'static str = "Grandpa"

Source§

const STORAGE_NAME: &'static str = "StoredState"

Source§

type VALUE = StoredState

Source§

impl StorageValue for DidUpdate

Source§

const PALLET_NAME: &'static str = "Timestamp"

Source§

const STORAGE_NAME: &'static str = "DidUpdate"

Source§

type VALUE = bool

Source§

impl StorageValue for Now

Source§

const PALLET_NAME: &'static str = "Timestamp"

Source§

const STORAGE_NAME: &'static str = "Now"

Source§

type VALUE = u64