Trait scrypto_test::prelude::SubstateDatabase
source · pub trait SubstateDatabase {
// Required methods
fn get_substate(
&self,
partition_key: &DbPartitionKey,
sort_key: &DbSortKey
) -> Option<Vec<u8>>;
fn list_entries_from(
&self,
partition_key: &DbPartitionKey,
from_sort_key: Option<&DbSortKey>
) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>;
// Provided method
fn list_entries(
&self,
partition_key: &DbPartitionKey
) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_> { ... }
}
Expand description
A read interface between Track and a database vendor.
Required Methods§
sourcefn get_substate(
&self,
partition_key: &DbPartitionKey,
sort_key: &DbSortKey
) -> Option<Vec<u8>>
fn get_substate( &self, partition_key: &DbPartitionKey, sort_key: &DbSortKey ) -> Option<Vec<u8>>
Reads a substate value by its partition and sort key, or Option::None
if missing.
sourcefn list_entries_from(
&self,
partition_key: &DbPartitionKey,
from_sort_key: Option<&DbSortKey>
) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>
fn list_entries_from( &self, partition_key: &DbPartitionKey, from_sort_key: Option<&DbSortKey> ) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>
Provided Methods§
sourcefn list_entries(
&self,
partition_key: &DbPartitionKey
) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>
fn list_entries( &self, partition_key: &DbPartitionKey ) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>
Iterates over all entries of the given partition, in a lexicographical order (ascending)
of the DbSortKey
s.
This is a convenience method, equivalent to Self::list_entries_from()
with the starting
key set to None
.