Skip to main content

InMemorySubstateDatabase

Struct InMemorySubstateDatabase 

Source
pub struct InMemorySubstateDatabase { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl Clone for InMemorySubstateDatabase

Source§

fn clone(&self) -> InMemorySubstateDatabase

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommittableSubstateDatabase for InMemorySubstateDatabase

Source§

fn commit(&mut self, database_updates: &DatabaseUpdates)

Commits state changes to the database.
Source§

impl Debug for InMemorySubstateDatabase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for InMemorySubstateDatabase

Source§

impl ListableSubstateDatabase for InMemorySubstateDatabase

Source§

fn list_partition_keys(&self) -> Box<dyn Iterator<Item = DbPartitionKey> + '_>

Iterates over all partition keys, in an arbitrary order. Read more
Source§

impl PartialEq for InMemorySubstateDatabase

Source§

fn eq(&self, other: &InMemorySubstateDatabase) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for InMemorySubstateDatabase

Source§

impl SubstateDatabase for InMemorySubstateDatabase

Source§

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 more
Source§

fn list_raw_values_from_db_key( &self, partition_key: &DbPartitionKey, from_sort_key: Option<&DbSortKey>, ) -> Box<dyn Iterator<Item = PartitionEntry> + '_>

Iterates over all entries of the given partition (starting either from the beginning, or from the given DbSortKey), in a lexicographical order (ascending) of the DbSortKeys. Note: If the exact given starting key does not exist, the iteration starts with its immediate successor. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>, U: Sized,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CommittableSubstateDatabaseExtensions for T

Source§

fn update_substate_raw<'a>( &mut self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, substate_key: impl ResolvableSubstateKey<'a>, value: Vec<u8>, )

Source§

fn delete_substate<'a>( &mut self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, substate_key: impl ResolvableSubstateKey<'a>, )

Source§

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 T
where U: ContextualTryFrom<T>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<X, Y> LabelledResolve<Y> for X
where Y: LabelledResolveFrom<X>,

Source§

fn labelled_resolve( self, resolver: &impl LabelResolver<<Y as LabelledResolvable>::ResolverOutput>, ) -> Y

Source§

impl<T> ListableSubstateDatabaseExtensions for T

Source§

fn read_partition_keys( &self, ) -> Box<dyn Iterator<Item = (NodeId, PartitionNumber)> + '_>

Source§

impl<X, Y> Resolve<Y> for X
where Y: ResolveFrom<X>,

Source§

fn resolve(self) -> Y

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SubstateDatabaseExtensions for T
where 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>>

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,

Gets the substate’s value, if it exists, and returns it decoded as Some(V). If it doesn’t exist, None is returned. Read more
Source§

fn get_existing_substate<'a, V>( &self, node_id: impl AsRef<NodeId>, partition_number: PartitionNumber, substate_key: impl ResolvableSubstateKey<'a>, ) -> V
where V: ScryptoDecode,

Gets the value of a subsate which is expected to exist, returns it decoded as V. Read more
Source§

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>)> + '_>

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)> + '_>

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>)> + '_>

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,

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)> + '_>
where K: TryFrom<u8>, V: ScryptoDecode,

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>)> + '_>

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,

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)> + '_>

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>)> + '_>

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,

Returns an iterator of the substates of a sorted partition from an inclusive start cursor. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.