[][src]Trait muta_protocol::traits::ServiceSDK

pub trait ServiceSDK {
    fn alloc_or_recover_map<Key: 'static + FixedCodec + PartialEq, Val: 'static + FixedCodec>(
        &mut self,
        var_name: &str
    ) -> ProtocolResult<Box<dyn StoreMap<Key, Val>>>;
fn alloc_or_recover_array<Elm: 'static + FixedCodec>(
        &mut self,
        var_name: &str
    ) -> ProtocolResult<Box<dyn StoreArray<Elm>>>;
fn alloc_or_recover_uint64(
        &mut self,
        var_name: &str
    ) -> ProtocolResult<Box<dyn StoreUint64>>;
fn alloc_or_recover_string(
        &mut self,
        var_name: &str
    ) -> ProtocolResult<Box<dyn StoreString>>;
fn alloc_or_recover_bool(
        &mut self,
        var_name: &str
    ) -> ProtocolResult<Box<dyn StoreBool>>;
fn get_value<Key: FixedCodec, Ret: FixedCodec>(
        &self,
        key: &Key
    ) -> ProtocolResult<Option<Ret>>;
fn set_value<Key: FixedCodec, Val: FixedCodec>(
        &mut self,
        key: Key,
        val: Val
    ) -> 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 get_transaction_by_hash(
        &self,
        tx_hash: &Hash
    ) -> ProtocolResult<Option<SignedTransaction>>;
fn get_epoch_by_epoch_id(
        &self,
        epoch_id: Option<u64>
    ) -> ProtocolResult<Option<Epoch>>;
fn get_receipt_by_hash(
        &self,
        tx_hash: &Hash
    ) -> ProtocolResult<Option<Receipt>>;
fn read(
        &self,
        service: &str,
        method: &str,
        payload: &str
    ) -> ProtocolResult<&str>;
fn write(
        &mut self,
        service: &str,
        method: &str,
        payload: &str
    ) -> ProtocolResult<&str>; }

Required methods

fn alloc_or_recover_map<Key: 'static + FixedCodec + PartialEq, Val: 'static + FixedCodec>(
    &mut self,
    var_name: &str
) -> ProtocolResult<Box<dyn StoreMap<Key, Val>>>

fn alloc_or_recover_array<Elm: 'static + FixedCodec>(
    &mut self,
    var_name: &str
) -> ProtocolResult<Box<dyn StoreArray<Elm>>>

fn alloc_or_recover_uint64(
    &mut self,
    var_name: &str
) -> ProtocolResult<Box<dyn StoreUint64>>

fn alloc_or_recover_string(
    &mut self,
    var_name: &str
) -> ProtocolResult<Box<dyn StoreString>>

fn alloc_or_recover_bool(
    &mut self,
    var_name: &str
) -> ProtocolResult<Box<dyn StoreBool>>

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

fn set_value<Key: FixedCodec, Val: FixedCodec>(
    &mut self,
    key: Key,
    val: Val
) -> 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 get_transaction_by_hash(
    &self,
    tx_hash: &Hash
) -> ProtocolResult<Option<SignedTransaction>>

fn get_epoch_by_epoch_id(
    &self,
    epoch_id: Option<u64>
) -> ProtocolResult<Option<Epoch>>

fn get_receipt_by_hash(&self, tx_hash: &Hash) -> ProtocolResult<Option<Receipt>>

fn read(
    &self,
    service: &str,
    method: &str,
    payload: &str
) -> ProtocolResult<&str>

fn write(
    &mut self,
    service: &str,
    method: &str,
    payload: &str
) -> ProtocolResult<&str>

Loading content...

Implementors

Loading content...