Trait OnChainConfig

Source
pub trait OnChainConfig:
    Send
    + Sync
    + DeserializeOwned {
    const IDENTIFIER: &'static str;
    const ADDRESS: &'static str = CONFIG_ADDRESS_STR;
    const CONFIG_ID: ConfigID = _;

    // Provided methods
    fn deserialize_default_impl(bytes: &[u8]) -> Result<Self> { ... }
    fn deserialize_into_config(bytes: &[u8]) -> Result<Self> { ... }
    fn fetch_config<T>(storage: &T) -> Option<Self>
       where T: ConfigStorage { ... }
}
Expand description

Trait to be implemented by a Rust struct representation of an on-chain config that is stored in storage as a serialized byte array

Required Associated Constants§

Source

const IDENTIFIER: &'static str

Provided Associated Constants§

Source

const ADDRESS: &'static str = CONFIG_ADDRESS_STR

Source

const CONFIG_ID: ConfigID = _

Provided Methods§

Source

fn deserialize_default_impl(bytes: &[u8]) -> Result<Self>

Source

fn deserialize_into_config(bytes: &[u8]) -> Result<Self>

Source

fn fetch_config<T>(storage: &T) -> Option<Self>
where T: ConfigStorage,

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 OnChainConfig for Limit

Source§

const IDENTIFIER: &'static str = "Limit"

Source§

impl OnChainConfig for EpochState

Source§

const IDENTIFIER: &'static str = "DiemSystem"

Source§

impl OnChainConfig for ValidatorVerifier

Source§

const IDENTIFIER: &'static str = "DiemSystem"

Source§

impl OnChainConfig for DiemVersion

Source§

const IDENTIFIER: &'static str = "DiemVersion"

Source§

impl OnChainConfig for RegisteredCurrencies

Source§

const IDENTIFIER: &'static str = "RegisteredCurrencies"

Source§

impl OnChainConfig for VMConfig

Source§

const IDENTIFIER: &'static str = "DiemVMConfig"

Source§

impl OnChainConfig for VMPublishingOption

Source§

const IDENTIFIER: &'static str = "DiemTransactionPublishingOption"

Source§

impl OnChainConfig for ValidatorSet

Source§

const IDENTIFIER: &'static str = "DiemSystem"