Trait ServiceState

Source
pub trait ServiceState {
    // Required methods
    fn get<Key: FixedCodec, Ret: FixedCodec>(
        &self,
        key: &Key,
    ) -> ProtocolResult<Option<Ret>>;
    fn contains<Key: FixedCodec>(&self, key: &Key) -> ProtocolResult<bool>;
    fn insert<Key: FixedCodec, Value: FixedCodec>(
        &mut self,
        key: Key,
        value: Value,
    ) -> ProtocolResult<()>;
    fn get_account_value<Key: FixedCodec, Ret: FixedCodec>(
        &self,
        address: &Address,
        key: &Key,
    ) -> ProtocolResult<Option<Ret>>;
    fn set_account_value<Key: FixedCodec, Val: FixedCodec>(
        &mut self,
        address: &Address,
        key: Key,
        val: Val,
    ) -> ProtocolResult<()>;
    fn revert_cache(&mut self) -> ProtocolResult<()>;
    fn stash(&mut self) -> ProtocolResult<()>;
    fn commit(&mut self) -> ProtocolResult<MerkleRoot>;
}

Required Methods§

Source

fn get<Key: FixedCodec, Ret: FixedCodec>( &self, key: &Key, ) -> ProtocolResult<Option<Ret>>

Source

fn contains<Key: FixedCodec>(&self, key: &Key) -> ProtocolResult<bool>

Source

fn insert<Key: FixedCodec, Value: FixedCodec>( &mut self, key: Key, value: Value, ) -> ProtocolResult<()>

Source

fn get_account_value<Key: FixedCodec, Ret: FixedCodec>( &self, address: &Address, key: &Key, ) -> ProtocolResult<Option<Ret>>

Source

fn set_account_value<Key: FixedCodec, Val: FixedCodec>( &mut self, address: &Address, key: Key, val: Val, ) -> ProtocolResult<()>

Source

fn revert_cache(&mut self) -> ProtocolResult<()>

Source

fn stash(&mut self) -> ProtocolResult<()>

Source

fn commit(&mut self) -> ProtocolResult<MerkleRoot>

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§