Trait linera_execution::BaseRuntime
source · 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§
sourcefn application_id(&self) -> UserApplicationId
fn application_id(&self) -> UserApplicationId
The current application id.
sourcefn application_parameters(&self) -> Vec<u8> ⓘ
fn application_parameters(&self) -> Vec<u8> ⓘ
The current application parameters.
sourcefn read_system_balance(&self) -> Amount
fn read_system_balance(&self) -> Amount
Reads the system balance.
sourcefn read_system_timestamp(&self) -> Timestamp
fn read_system_timestamp(&self) -> Timestamp
Reads the system timestamp.
sourcefn 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 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.
sourcefn 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 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
sourcefn 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 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
sourcefn 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 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
sourcefn 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_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.
sourcefn 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,
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.