pub struct StateTreeUpdatingDatabase<D> { /* private fields */ }Implementations§
Source§impl<D> StateTreeUpdatingDatabase<D>
impl<D> StateTreeUpdatingDatabase<D>
pub fn new(underlying: D) -> Self
pub fn get_current_root_hash(&self) -> Hash
pub fn get_current_version(&self) -> Version
pub fn list_substate_hashes( &self, ) -> IndexMap<DbPartitionKey, IndexMap<DbSortKey, Hash>>
Source§impl<D> StateTreeUpdatingDatabase<D>where
D: SubstateDatabase + ListableSubstateDatabase,
impl<D> StateTreeUpdatingDatabase<D>where
D: SubstateDatabase + ListableSubstateDatabase,
pub fn validate_state_tree_matches_substate_store( &self, ) -> Result<(), StateTreeValidationError>
Trait Implementations§
Source§impl<D: Clone> Clone for StateTreeUpdatingDatabase<D>
impl<D: Clone> Clone for StateTreeUpdatingDatabase<D>
Source§fn clone(&self) -> StateTreeUpdatingDatabase<D>
fn clone(&self) -> StateTreeUpdatingDatabase<D>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: CommittableSubstateDatabase> CommittableSubstateDatabase for StateTreeUpdatingDatabase<D>
impl<D: CommittableSubstateDatabase> CommittableSubstateDatabase for StateTreeUpdatingDatabase<D>
Source§fn commit(&mut self, database_updates: &DatabaseUpdates)
fn commit(&mut self, database_updates: &DatabaseUpdates)
Commits state changes to the database.
Source§impl<D: Debug> Debug for StateTreeUpdatingDatabase<D>
impl<D: Debug> Debug for StateTreeUpdatingDatabase<D>
impl<D: Eq> Eq for StateTreeUpdatingDatabase<D>
Source§impl<D: ListableSubstateDatabase> ListableSubstateDatabase for StateTreeUpdatingDatabase<D>
impl<D: ListableSubstateDatabase> ListableSubstateDatabase for StateTreeUpdatingDatabase<D>
Source§fn list_partition_keys(&self) -> Box<dyn Iterator<Item = DbPartitionKey> + '_>
fn list_partition_keys(&self) -> Box<dyn Iterator<Item = DbPartitionKey> + '_>
Iterates over all partition keys, in an arbitrary order. Read more
Source§impl<D: PartialEq> PartialEq for StateTreeUpdatingDatabase<D>
impl<D: PartialEq> PartialEq for StateTreeUpdatingDatabase<D>
Source§fn eq(&self, other: &StateTreeUpdatingDatabase<D>) -> bool
fn eq(&self, other: &StateTreeUpdatingDatabase<D>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<D: PartialEq> StructuralPartialEq for StateTreeUpdatingDatabase<D>
Source§impl<D: SubstateDatabase> SubstateDatabase for StateTreeUpdatingDatabase<D>
impl<D: SubstateDatabase> SubstateDatabase for StateTreeUpdatingDatabase<D>
Source§fn get_raw_substate_by_db_key(
&self,
partition_key: &DbPartitionKey,
sort_key: &DbSortKey,
) -> Option<DbSubstateValue>
fn get_raw_substate_by_db_key( &self, partition_key: &DbPartitionKey, sort_key: &DbSortKey, ) -> Option<DbSubstateValue>
Reads a substate value by its db partition and db sort key, or
Option::None if missing. Read moreSource§fn list_raw_values_from_db_key(
&self,
partition_key: &DbPartitionKey,
from_sort_key: Option<&DbSortKey>,
) -> Box<dyn Iterator<Item = PartitionEntry> + '_>
fn list_raw_values_from_db_key( &self, partition_key: &DbPartitionKey, from_sort_key: Option<&DbSortKey>, ) -> Box<dyn Iterator<Item = PartitionEntry> + '_>
Auto Trait Implementations§
impl<D> !Freeze for StateTreeUpdatingDatabase<D>
impl<D> !RefUnwindSafe for StateTreeUpdatingDatabase<D>
impl<D> !Sync for StateTreeUpdatingDatabase<D>
impl<D> Send for StateTreeUpdatingDatabase<D>where
D: Send,
impl<D> Unpin for StateTreeUpdatingDatabase<D>where
D: Unpin,
impl<D> UnsafeUnpin for StateTreeUpdatingDatabase<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for StateTreeUpdatingDatabase<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CommittableSubstateDatabaseExtensions for Twhere
T: CommittableSubstateDatabase + ?Sized,
impl<T> CommittableSubstateDatabaseExtensions for Twhere
T: CommittableSubstateDatabase + ?Sized,
fn update_substate_raw<'a>( &mut self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, substate_key: impl ResolvableSubstateKey<'a>, value: Vec<u8>, )
fn delete_substate<'a>( &mut self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, substate_key: impl ResolvableSubstateKey<'a>, )
fn update_substate<'a, E>(
&mut self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
substate_key: impl ResolvableSubstateKey<'a>,
value: E,
)where
E: ScryptoEncode,
Source§impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<X, Y> LabelledResolve<Y> for Xwhere
Y: LabelledResolveFrom<X>,
impl<X, Y> LabelledResolve<Y> for Xwhere
Y: LabelledResolveFrom<X>,
fn labelled_resolve( self, resolver: &impl LabelResolver<<Y as LabelledResolvable>::ResolverOutput>, ) -> Y
Source§impl<T> ListableSubstateDatabaseExtensions for Twhere
T: ListableSubstateDatabase + ?Sized,
impl<T> ListableSubstateDatabaseExtensions for Twhere
T: ListableSubstateDatabase + ?Sized,
fn read_partition_keys( &self, ) -> Box<dyn Iterator<Item = (NodeId, PartitionNumber)> + '_>
Source§impl<T> SubstateDatabaseExtensions for Twhere
T: SubstateDatabase + ?Sized,
impl<T> SubstateDatabaseExtensions for Twhere
T: SubstateDatabase + ?Sized,
Source§fn get_raw_substate<'a>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
substate_key: impl ResolvableSubstateKey<'a>,
) -> Option<Vec<u8>>
fn get_raw_substate<'a>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, substate_key: impl ResolvableSubstateKey<'a>, ) -> Option<Vec<u8>>
Gets the raw bytes of the substate’s value, if it exists. Read more
Source§fn get_substate<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
substate_key: impl ResolvableSubstateKey<'a>,
) -> Option<V>where
V: ScryptoDecode,
fn get_substate<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
substate_key: impl ResolvableSubstateKey<'a>,
) -> Option<V>where
V: ScryptoDecode,
Gets the substate’s value, if it exists, and returns it decoded as
Some(V).
If it doesn’t exist, None is returned. Read moreSource§fn get_existing_substate<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
substate_key: impl ResolvableSubstateKey<'a>,
) -> Vwhere
V: ScryptoDecode,
fn get_existing_substate<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
substate_key: impl ResolvableSubstateKey<'a>,
) -> Vwhere
V: ScryptoDecode,
Gets the value of a subsate which is expected to exist, returns it decoded as
V. Read moreSource§fn list_raw_values<'a>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>
fn list_raw_values<'a>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>, ) -> Box<dyn Iterator<Item = (DbSortKey, Vec<u8>)> + '_>
Returns an iterator of the substates of a partition from an inclusive start cursor. Read more
Source§fn list_kinded_raw_values<'a, K>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, Vec<u8>)> + '_>where
K: SubstateKeyContent,
fn list_kinded_raw_values<'a, K>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, Vec<u8>)> + '_>where
K: SubstateKeyContent,
Returns an iterator of the substates of a partition from an inclusive start cursor. Read more
Source§fn list_kinded_values<'a, K, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, V)> + '_>where
K: SubstateKeyContent,
V: ScryptoDecode,
fn list_kinded_values<'a, K, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, V)> + '_>where
K: SubstateKeyContent,
V: ScryptoDecode,
Returns an iterator of the substates of a partition from an inclusive start cursor. Read more
Source§fn list_field_raw_values<'a>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (u8, Vec<u8>)> + '_>
fn list_field_raw_values<'a>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>, ) -> Box<dyn Iterator<Item = (u8, Vec<u8>)> + '_>
Returns an iterator of the substates of a field partition from an inclusive start cursor. Read more
Source§fn list_field_values<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (u8, V)> + '_>where
V: ScryptoDecode,
fn list_field_values<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (u8, V)> + '_>where
V: ScryptoDecode,
Returns an iterator of the substates of a field partition from an inclusive start cursor. Read more
Source§fn list_field_entries<'a, K, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, V)> + '_>
fn list_field_entries<'a, K, V>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>, ) -> Box<dyn Iterator<Item = (K, V)> + '_>
Returns an iterator of the substates of a field partition from an inclusive start cursor. Read more
Source§fn list_map_raw_values<'a>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + '_>
fn list_map_raw_values<'a>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>, ) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + '_>
Returns an iterator of the substates of a map partition from an inclusive start cursor. Read more
Source§fn list_map_values<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (Vec<u8>, V)> + '_>where
V: ScryptoDecode,
fn list_map_values<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (Vec<u8>, V)> + '_>where
V: ScryptoDecode,
Returns an iterator of the substates of a map partition from an inclusive start cursor. Read more
Source§fn list_map_entries<'a, K, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, V)> + '_>where
K: ScryptoDecode,
V: ScryptoDecode,
fn list_map_entries<'a, K, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (K, V)> + '_>where
K: ScryptoDecode,
V: ScryptoDecode,
Returns an iterator of the substates of a map partition from an inclusive start cursor. Read more
Source§fn list_sorted_raw_values<'a>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (([u8; 2], Vec<u8>), Vec<u8>)> + '_>
fn list_sorted_raw_values<'a>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>, ) -> Box<dyn Iterator<Item = (([u8; 2], Vec<u8>), Vec<u8>)> + '_>
Returns an iterator of the substates of a sorted partition from an inclusive start cursor. Read more
Source§fn list_sorted_values<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (([u8; 2], Vec<u8>), V)> + '_>where
V: ScryptoDecode,
fn list_sorted_values<'a, V>(
&self,
node_id: impl AsRef<NodeId>,
partition_number: PartitionNumber,
from_substate_key_inclusive: impl ResolvableOptionalSubstateKey<'a>,
) -> Box<dyn Iterator<Item = (([u8; 2], Vec<u8>), V)> + '_>where
V: ScryptoDecode,
Returns an iterator of the substates of a sorted partition from an inclusive start cursor. Read more