Struct scrypto_test::prelude::state_updates::StateUpdates
source · pub struct StateUpdates {
pub by_node: IndexMap<NodeId, NodeStateUpdates>,
}
Expand description
A tree-like description of all updates that happened to a stored state, to be included as a part
of a transaction receipt.
This structure is indexed (i.e. uses IndexMap
s where Vec
s could be used) for convenience
and performance, since both the source (i.e. Track) and the sink (i.e. Database and API) operate
on indexed structures too.
This structure maintains partial information on the order of operations (please see individual
fields for details), since the end users care about it. Please note that this means multiple
instances of StateUpdates
can represent the same transform of state store (i.e. differing
only by order of some operations), and hence it is not 100% “canonical form”.
Fields§
§by_node: IndexMap<NodeId, NodeStateUpdates>
Indexed Node-level updates, captured in the order of first update operation to a Node.
Implementations§
source§impl StateUpdates
impl StateUpdates
sourcepub fn of_node(&mut self, node_id: NodeId) -> &mut NodeStateUpdates
pub fn of_node(&mut self, node_id: NodeId) -> &mut NodeStateUpdates
Starts a Node-level update.
pub fn into_legacy(self) -> LegacyStateUpdates
source§impl StateUpdates
impl StateUpdates
sourcepub fn create_database_updates<M>(&self) -> DatabaseUpdateswhere
M: DatabaseKeyMapper,
pub fn create_database_updates<M>(&self) -> DatabaseUpdateswhere
M: DatabaseKeyMapper,
Uses the given DatabaseKeyMapper
to express self using database-level key encoding.
Trait Implementations§
source§impl<X> Categorize<X> for StateUpdateswhere
X: CustomValueKind,
impl<X> Categorize<X> for StateUpdateswhere
X: CustomValueKind,
fn value_kind() -> ValueKind<X>
source§impl Clone for StateUpdates
impl Clone for StateUpdates
source§fn clone(&self) -> StateUpdates
fn clone(&self) -> StateUpdates
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for StateUpdates
impl Debug for StateUpdates
source§impl<D, X> Decode<X, D> for StateUpdateswhere
D: Decoder<X>,
X: CustomValueKind,
impl<D, X> Decode<X, D> for StateUpdateswhere
D: Decoder<X>,
X: CustomValueKind,
source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<X>
) -> Result<StateUpdates, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<X> ) -> Result<StateUpdates, DecodeError>
source§impl Default for StateUpdates
impl Default for StateUpdates
source§fn default() -> StateUpdates
fn default() -> StateUpdates
source§impl<C> Describe<C> for StateUpdateswhere
C: CustomTypeKind<RustTypeId>,
impl<C> Describe<C> for StateUpdateswhere
C: CustomTypeKind<RustTypeId>,
source§const TYPE_ID: RustTypeId = _
const TYPE_ID: RustTypeId = _
TYPE_ID
should give a unique identifier for its SBOR schema type.
An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read moresource§fn type_data() -> TypeData<C, RustTypeId>
fn type_data() -> TypeData<C, RustTypeId>
source§fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
get_local_type_data
, we need to ensure that the type and all of its own references
get added to the aggregator. Read moresource§impl<E, X> Encode<X, E> for StateUpdateswhere
E: Encoder<X>,
X: CustomValueKind,
impl<E, X> Encode<X, E> for StateUpdateswhere
E: Encoder<X>,
X: CustomValueKind,
source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
source§impl From<LegacyStateUpdates> for StateUpdates
impl From<LegacyStateUpdates> for StateUpdates
source§fn from(legacy_state_updates: LegacyStateUpdates) -> StateUpdates
fn from(legacy_state_updates: LegacyStateUpdates) -> StateUpdates
source§impl From<StateUpdates> for LegacyStateUpdates
impl From<StateUpdates> for LegacyStateUpdates
source§fn from(state_updates: StateUpdates) -> LegacyStateUpdates
fn from(state_updates: StateUpdates) -> LegacyStateUpdates
source§impl PartialEq for StateUpdates
impl PartialEq for StateUpdates
source§fn eq(&self, other: &StateUpdates) -> bool
fn eq(&self, other: &StateUpdates) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<X> SborTuple<X> for StateUpdateswhere
X: CustomValueKind,
impl<X> SborTuple<X> for StateUpdateswhere
X: CustomValueKind,
fn get_length(&self) -> usize
impl Eq for StateUpdates
impl StructuralPartialEq for StateUpdates
Auto Trait Implementations§
impl RefUnwindSafe for StateUpdates
impl Send for StateUpdates
impl Sync for StateUpdates
impl Unpin for StateUpdates
impl UnwindSafe for StateUpdates
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
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 moresource§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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.