pub trait ServiceSDK {
Show 14 methods
// 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,
ctx: &ServiceContext,
service: &str,
method: &str,
payload: &str,
) -> ProtocolResult<String>;
fn write(
&mut self,
ctx: &ServiceContext,
service: &str,
method: &str,
payload: &str,
) -> ProtocolResult<String>;
}
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, ctx: &ServiceContext, service: &str, method: &str, payload: &str, ) -> ProtocolResult<String>
fn write( &mut self, ctx: &ServiceContext, service: &str, method: &str, payload: &str, ) -> ProtocolResult<String>
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.