Trait StateDbExt

Source
pub trait StateDbExt {
    // Required methods
    fn get<T>(&self, key: StorageKeyWithSpace<'_>) -> Result<Option<T>>
       where T: Decodable;
    fn set<T>(
        &mut self,
        key: StorageKeyWithSpace<'_>,
        value: &T,
        debug_record: Option<&mut ComputeEpochDebugRecord>,
    ) -> Result<()>
       where T: Encodable + IsDefault;
    fn get_account(&self, address: &AddressWithSpace) -> Result<Option<Account>>;
    fn get_code(
        &self,
        address: &AddressWithSpace,
        code_hash: &H256,
    ) -> Result<Option<CodeInfo>>;
    fn get_deposit_list(
        &self,
        address: &AddressWithSpace,
    ) -> Result<Option<DepositList>>;
    fn get_vote_list(
        &self,
        address: &AddressWithSpace,
    ) -> Result<Option<VoteStakeList>>;
    fn get_system_storage(&self, key: &[u8]) -> Result<U256>;
    fn get_global_param<T: GlobalParamKey>(&self) -> Result<U256>;
    fn set_global_param<T: GlobalParamKey>(
        &mut self,
        value: &U256,
        debug_record: Option<&mut ComputeEpochDebugRecord>,
    ) -> Result<()>;
    fn is_initialized(&self) -> Result<bool>;
}

Required Methods§

Source

fn get<T>(&self, key: StorageKeyWithSpace<'_>) -> Result<Option<T>>
where T: Decodable,

Source

fn set<T>( &mut self, key: StorageKeyWithSpace<'_>, value: &T, debug_record: Option<&mut ComputeEpochDebugRecord>, ) -> Result<()>
where T: Encodable + IsDefault,

Source

fn get_account(&self, address: &AddressWithSpace) -> Result<Option<Account>>

Source

fn get_code( &self, address: &AddressWithSpace, code_hash: &H256, ) -> Result<Option<CodeInfo>>

Source

fn get_deposit_list( &self, address: &AddressWithSpace, ) -> Result<Option<DepositList>>

Source

fn get_vote_list( &self, address: &AddressWithSpace, ) -> Result<Option<VoteStakeList>>

Source

fn get_system_storage(&self, key: &[u8]) -> Result<U256>

Source

fn get_global_param<T: GlobalParamKey>(&self) -> Result<U256>

Source

fn set_global_param<T: GlobalParamKey>( &mut self, value: &U256, debug_record: Option<&mut ComputeEpochDebugRecord>, ) -> Result<()>

Source

fn is_initialized(&self) -> Result<bool>

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§