pub trait StorageAddress {
    type Target: DecodeWithMetadata;
    type IsFetchable;
    type IsDefaultable;
    type IsIterable;

    fn pallet_name(&self) -> &str;
    fn entry_name(&self) -> &str;
    fn append_entry_bytes(
        &self,
        metadata: &Metadata,
        bytes: &mut Vec<u8>
    ) -> Result<(), Error>; fn validation_hash(&self) -> Option<[u8; 32]> { ... } }
Expand description

This represents a storage address. Anything implementing this trait can be used to fetch and iterate over storage entries.

Required Associated Types§

The target type of the value that lives at this address.

Can an entry be fetched from this address? Set this type to Yes to enable the corresponding calls to be made.

Can a default entry be obtained from this address? Set this type to Yes to enable the corresponding calls to be made.

Can this address be iterated over? Set this type to Yes to enable the corresponding calls to be made.

Required Methods§

The name of the pallet that the entry lives under.

The name of the entry in a given pallet that the item is at.

source

fn append_entry_bytes(
    &self,
    metadata: &Metadata,
    bytes: &mut Vec<u8>
) -> Result<(), Error>

Output the non-prefix bytes; that is, any additional bytes that need to be appended to the key to dig into maps.

Provided Methods§

An optional hash which, if present, will be checked against the node metadata to confirm that the return type matches what we are expecting.

Implementors§