Address

Trait Address 

Source
pub trait Address {
    type Target: DecodeWithMetadata;
    type IsDecodable;

    // Required method
    fn name(&self) -> &str;

    // Provided method
    fn validation_hash(&self) -> Option<[u8; 32]> { ... }
}
Expand description

This represents the address of a custom value in the metadata. Anything that implements it can be used to fetch custom values from the metadata. The trait is implemented by str for dynamic lookup and StaticAddress for static queries.

Required Associated Types§

Source

type Target: DecodeWithMetadata

The type of the custom value.

Source

type IsDecodable

Should be set to Yes for Dynamic values and static values that have a valid type. Should be () for custom values, that have an invalid type id.

Required Methods§

Source

fn name(&self) -> &str

the name (key) by which the custom value can be accessed in the metadata.

Provided Methods§

Source

fn validation_hash(&self) -> Option<[u8; 32]>

An optional hash which, if present, can be checked against node metadata.

Implementations on Foreign Types§

Source§

impl Address for str

Implementors§