pub struct SubstateDatabaseOverlay<S, D> { /* private fields */ }Implementations§
Source§impl<'a, D> SubstateDatabaseOverlay<&'a D, D>
impl<'a, D> SubstateDatabaseOverlay<&'a D, D>
pub fn new_unmergeable(root_database: &'a D) -> Self
Source§impl<'a, D> SubstateDatabaseOverlay<&'a mut D, D>
impl<'a, D> SubstateDatabaseOverlay<&'a mut D, D>
pub fn new_mergeable(root_database: &'a mut D) -> Self
Source§impl<D> SubstateDatabaseOverlay<D, D>
impl<D> SubstateDatabaseOverlay<D, D>
Source§impl<S, D> SubstateDatabaseOverlay<S, D>
impl<S, D> SubstateDatabaseOverlay<S, D>
pub fn new(root_database: S) -> Self
pub fn deconstruct(self) -> (S, DatabaseUpdates)
pub fn database_updates(&self) -> DatabaseUpdates
pub fn into_database_updates(self) -> DatabaseUpdates
Source§impl<S: BorrowMut<D>, D: CommittableSubstateDatabase> SubstateDatabaseOverlay<S, D>
impl<S: BorrowMut<D>, D: CommittableSubstateDatabase> SubstateDatabaseOverlay<S, D>
pub fn commit_overlay_into_root_store(&mut self)
Trait Implementations§
Source§impl<S, D> CommittableSubstateDatabase for SubstateDatabaseOverlay<S, D>
impl<S, D> CommittableSubstateDatabase for SubstateDatabaseOverlay<S, D>
Source§fn commit(&mut self, database_updates: &DatabaseUpdates)
fn commit(&mut self, database_updates: &DatabaseUpdates)
Commits state changes to the database.
Source§impl<S: Borrow<D>, D: ListableSubstateDatabase> ListableSubstateDatabase for SubstateDatabaseOverlay<S, D>
impl<S: Borrow<D>, D: ListableSubstateDatabase> ListableSubstateDatabase for SubstateDatabaseOverlay<S, 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<S: Borrow<D>, D: SubstateDatabase> SubstateDatabase for SubstateDatabaseOverlay<S, D>
impl<S: Borrow<D>, D: SubstateDatabase> SubstateDatabase for SubstateDatabaseOverlay<S, 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<S, D> Freeze for SubstateDatabaseOverlay<S, D>where
S: Freeze,
impl<S, D> RefUnwindSafe for SubstateDatabaseOverlay<S, D>where
S: RefUnwindSafe,
D: RefUnwindSafe,
impl<S, D> Send for SubstateDatabaseOverlay<S, D>
impl<S, D> Sync for SubstateDatabaseOverlay<S, D>
impl<S, D> Unpin for SubstateDatabaseOverlay<S, D>
impl<S, D> UnsafeUnpin for SubstateDatabaseOverlay<S, D>where
S: UnsafeUnpin,
impl<S, D> UnwindSafe for SubstateDatabaseOverlay<S, D>where
S: UnwindSafe,
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> 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<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