pub trait BaseRuntime: Send + Sync {
    // Required methods
    fn chain_id(&self) -> ChainId;
    fn application_id(&self) -> UserApplicationId;
    fn application_parameters(&self) -> Vec<u8> ;
    fn read_system_balance(&self) -> Amount;
    fn read_system_timestamp(&self) -> Timestamp;
    fn try_read_my_state<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn lock_view_user_state<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unlock_view_user_state<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn read_key_bytes<'life0, 'async_trait>(
        &'life0 self,
        key: Vec<u8>
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_keys_by_prefix<'life0, 'async_trait>(
        &'life0 self,
        key_prefix: Vec<u8>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_key_values_by_prefix<'life0, 'async_trait>(
        &'life0 self,
        key_prefix: Vec<u8>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn chain_id(&self) -> ChainId

The current chain id.

source

fn application_id(&self) -> UserApplicationId

The current application id.

source

fn application_parameters(&self) -> Vec<u8>

The current application parameters.

source

fn read_system_balance(&self) -> Amount

Reads the system balance.

source

fn read_system_timestamp(&self) -> Timestamp

Reads the system timestamp.

source

fn try_read_my_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Reads the application state.

source

fn lock_view_user_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Locks the view user state and prevents further reading/loading

source

fn unlock_view_user_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Unlocks the view user state and allows reading/loading again

source

fn read_key_bytes<'life0, 'async_trait>( &'life0 self, key: Vec<u8> ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Reads the key from the KV store

source

fn find_keys_by_prefix<'life0, 'async_trait>( &'life0 self, key_prefix: Vec<u8> ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Reads the data from the keys having a specific prefix.

source

fn find_key_values_by_prefix<'life0, 'async_trait>( &'life0 self, key_prefix: Vec<u8> ) -> Pin<Box<dyn Future<Output = Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Reads the data from the key/values having a specific prefix.

Implementors§