Trait linera_execution::BaseRuntime
source · pub trait BaseRuntime {
type Read: Debug + Send;
type ContainsKey: Debug + Send;
type ReadMultiValuesBytes: Debug + Send;
type ReadValueBytes: Debug + Send;
type FindKeysByPrefix: Debug + Send;
type FindKeyValuesByPrefix: Debug + Send;
Show 21 methods
// Required methods
fn chain_id(&mut self) -> Result<ChainId, ExecutionError>;
fn block_height(&mut self) -> Result<BlockHeight, ExecutionError>;
fn application_id(&mut self) -> Result<UserApplicationId, ExecutionError>;
fn application_parameters(&mut self) -> Result<Vec<u8>, ExecutionError>;
fn read_system_timestamp(&mut self) -> Result<Timestamp, ExecutionError>;
fn read_chain_balance(&mut self) -> Result<Amount, ExecutionError>;
fn read_owner_balance(
&mut self,
owner: Owner
) -> Result<Amount, ExecutionError>;
fn read_owner_balances(
&mut self
) -> Result<Vec<(Owner, Amount)>, ExecutionError>;
fn read_balance_owners(&mut self) -> Result<Vec<Owner>, ExecutionError>;
fn chain_ownership(&mut self) -> Result<ChainOwnership, ExecutionError>;
fn contains_key_new(
&mut self,
key: Vec<u8>
) -> Result<Self::ContainsKey, ExecutionError>;
fn contains_key_wait(
&mut self,
promise: &Self::ContainsKey
) -> Result<bool, ExecutionError>;
fn read_multi_values_bytes_new(
&mut self,
keys: Vec<Vec<u8>>
) -> Result<Self::ReadMultiValuesBytes, ExecutionError>;
fn read_multi_values_bytes_wait(
&mut self,
promise: &Self::ReadMultiValuesBytes
) -> Result<Vec<Option<Vec<u8>>>, ExecutionError>;
fn write_batch(&mut self, batch: Batch) -> Result<(), ExecutionError>;
fn read_value_bytes_new(
&mut self,
key: Vec<u8>
) -> Result<Self::ReadValueBytes, ExecutionError>;
fn read_value_bytes_wait(
&mut self,
promise: &Self::ReadValueBytes
) -> Result<Option<Vec<u8>>, ExecutionError>;
fn find_keys_by_prefix_new(
&mut self,
key_prefix: Vec<u8>
) -> Result<Self::FindKeysByPrefix, ExecutionError>;
fn find_keys_by_prefix_wait(
&mut self,
promise: &Self::FindKeysByPrefix
) -> Result<Vec<Vec<u8>>, ExecutionError>;
fn find_key_values_by_prefix_new(
&mut self,
key_prefix: Vec<u8>
) -> Result<Self::FindKeyValuesByPrefix, ExecutionError>;
fn find_key_values_by_prefix_wait(
&mut self,
promise: &Self::FindKeyValuesByPrefix
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>;
}Required Associated Types§
type Read: Debug + Send
type ContainsKey: Debug + Send
type ReadMultiValuesBytes: Debug + Send
type ReadValueBytes: Debug + Send
type FindKeysByPrefix: Debug + Send
type FindKeyValuesByPrefix: Debug + Send
Required Methods§
sourcefn chain_id(&mut self) -> Result<ChainId, ExecutionError>
fn chain_id(&mut self) -> Result<ChainId, ExecutionError>
The current chain ID.
sourcefn block_height(&mut self) -> Result<BlockHeight, ExecutionError>
fn block_height(&mut self) -> Result<BlockHeight, ExecutionError>
The current block height.
sourcefn application_id(&mut self) -> Result<UserApplicationId, ExecutionError>
fn application_id(&mut self) -> Result<UserApplicationId, ExecutionError>
The current application ID.
sourcefn application_parameters(&mut self) -> Result<Vec<u8>, ExecutionError>
fn application_parameters(&mut self) -> Result<Vec<u8>, ExecutionError>
The current application parameters.
sourcefn read_system_timestamp(&mut self) -> Result<Timestamp, ExecutionError>
fn read_system_timestamp(&mut self) -> Result<Timestamp, ExecutionError>
Reads the system timestamp.
sourcefn read_chain_balance(&mut self) -> Result<Amount, ExecutionError>
fn read_chain_balance(&mut self) -> Result<Amount, ExecutionError>
Reads the balance of the chain.
sourcefn read_owner_balance(&mut self, owner: Owner) -> Result<Amount, ExecutionError>
fn read_owner_balance(&mut self, owner: Owner) -> Result<Amount, ExecutionError>
Reads the owner balance.
sourcefn read_owner_balances(
&mut self
) -> Result<Vec<(Owner, Amount)>, ExecutionError>
fn read_owner_balances( &mut self ) -> Result<Vec<(Owner, Amount)>, ExecutionError>
Reads the balances from all owners.
sourcefn read_balance_owners(&mut self) -> Result<Vec<Owner>, ExecutionError>
fn read_balance_owners(&mut self) -> Result<Vec<Owner>, ExecutionError>
Reads balance owners.
sourcefn chain_ownership(&mut self) -> Result<ChainOwnership, ExecutionError>
fn chain_ownership(&mut self) -> Result<ChainOwnership, ExecutionError>
Reads the current ownership configuration for this chain.
sourcefn contains_key_new(
&mut self,
key: Vec<u8>
) -> Result<Self::ContainsKey, ExecutionError>
fn contains_key_new( &mut self, key: Vec<u8> ) -> Result<Self::ContainsKey, ExecutionError>
Tests whether a key exists in the key-value store (new)
sourcefn contains_key_wait(
&mut self,
promise: &Self::ContainsKey
) -> Result<bool, ExecutionError>
fn contains_key_wait( &mut self, promise: &Self::ContainsKey ) -> Result<bool, ExecutionError>
Tests whether a key exists in the key-value store (wait)
sourcefn read_multi_values_bytes_new(
&mut self,
keys: Vec<Vec<u8>>
) -> Result<Self::ReadMultiValuesBytes, ExecutionError>
fn read_multi_values_bytes_new( &mut self, keys: Vec<Vec<u8>> ) -> Result<Self::ReadMultiValuesBytes, ExecutionError>
Reads several keys from the key-value store (new)
sourcefn read_multi_values_bytes_wait(
&mut self,
promise: &Self::ReadMultiValuesBytes
) -> Result<Vec<Option<Vec<u8>>>, ExecutionError>
fn read_multi_values_bytes_wait( &mut self, promise: &Self::ReadMultiValuesBytes ) -> Result<Vec<Option<Vec<u8>>>, ExecutionError>
Reads several keys from the key-value store (wait)
sourcefn write_batch(&mut self, batch: Batch) -> Result<(), ExecutionError>
fn write_batch(&mut self, batch: Batch) -> Result<(), ExecutionError>
Writes a batch of changes.
Hack: This fails for services.
sourcefn read_value_bytes_new(
&mut self,
key: Vec<u8>
) -> Result<Self::ReadValueBytes, ExecutionError>
fn read_value_bytes_new( &mut self, key: Vec<u8> ) -> Result<Self::ReadValueBytes, ExecutionError>
Reads the key from the key-value store (new)
sourcefn read_value_bytes_wait(
&mut self,
promise: &Self::ReadValueBytes
) -> Result<Option<Vec<u8>>, ExecutionError>
fn read_value_bytes_wait( &mut self, promise: &Self::ReadValueBytes ) -> Result<Option<Vec<u8>>, ExecutionError>
Reads the key from the key-value store (wait)
sourcefn find_keys_by_prefix_new(
&mut self,
key_prefix: Vec<u8>
) -> Result<Self::FindKeysByPrefix, ExecutionError>
fn find_keys_by_prefix_new( &mut self, key_prefix: Vec<u8> ) -> Result<Self::FindKeysByPrefix, ExecutionError>
Reads the data from the keys having a specific prefix (new).
sourcefn find_keys_by_prefix_wait(
&mut self,
promise: &Self::FindKeysByPrefix
) -> Result<Vec<Vec<u8>>, ExecutionError>
fn find_keys_by_prefix_wait( &mut self, promise: &Self::FindKeysByPrefix ) -> Result<Vec<Vec<u8>>, ExecutionError>
Reads the data from the keys having a specific prefix (wait).
sourcefn find_key_values_by_prefix_new(
&mut self,
key_prefix: Vec<u8>
) -> Result<Self::FindKeyValuesByPrefix, ExecutionError>
fn find_key_values_by_prefix_new( &mut self, key_prefix: Vec<u8> ) -> Result<Self::FindKeyValuesByPrefix, ExecutionError>
Reads the data from the key/values having a specific prefix (new).
sourcefn find_key_values_by_prefix_wait(
&mut self,
promise: &Self::FindKeyValuesByPrefix
) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>
fn find_key_values_by_prefix_wait( &mut self, promise: &Self::FindKeyValuesByPrefix ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, ExecutionError>
Reads the data from the key/values having a specific prefix (wait).