pub enum TransformKindV2 {
Identity,
Write(StoredValue),
AddInt32(i32),
AddUInt64(u64),
AddUInt128(U128),
AddUInt256(U256),
AddUInt512(U512),
AddKeys(NamedKeys),
Prune(Key),
Failure(TransformError),
}Expand description
Representation of a single transformation occurring during execution.
Note that all arithmetic variants of TransformKindV2 are commutative which means that a given
collection of them can be executed in any order to produce the same end result.
Variants§
Identity
An identity transformation that does not modify a value in the global state.
Created as a result of reading from the global state.
Write(StoredValue)
Writes a new value in the global state.
AddInt32(i32)
A wrapping addition of an i32 to an existing numeric value (not necessarily an i32) in
the global state.
AddUInt64(u64)
A wrapping addition of a u64 to an existing numeric value (not necessarily an u64) in
the global state.
AddUInt128(U128)
A wrapping addition of a U128 to an existing numeric value (not necessarily an U128) in
the global state.
AddUInt256(U256)
A wrapping addition of a U256 to an existing numeric value (not necessarily an U256) in
the global state.
AddUInt512(U512)
A wrapping addition of a U512 to an existing numeric value (not necessarily an U512) in
the global state.
AddKeys(NamedKeys)
Adds new named keys to an existing entry in the global state.
This transform assumes that the existing stored value is either an Account or a Contract.
Prune(Key)
Removes the pathing to the global state entry of the specified key. The pruned element remains reachable from previously generated global state root hashes, but will not be included in the next generated global state root hash and subsequent state accumulated from it.
Failure(TransformError)
Represents the case where applying a transform would cause an error.
Implementations§
Source§impl TransformKindV2
impl TransformKindV2
Sourcepub fn apply(
self,
stored_value: StoredValue,
) -> Result<TransformInstruction, TransformError>
pub fn apply( self, stored_value: StoredValue, ) -> Result<TransformInstruction, TransformError>
Applies the transformation on a specified stored value instance.
This method produces a new StoredValue instance based on the TransformKind variant.
Trait Implementations§
Source§impl Clone for TransformKindV2
impl Clone for TransformKindV2
Source§fn clone(&self) -> TransformKindV2
fn clone(&self) -> TransformKindV2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataSize for TransformKindV2
impl DataSize for TransformKindV2
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl Debug for TransformKindV2
impl Debug for TransformKindV2
Source§impl Default for TransformKindV2
impl Default for TransformKindV2
Source§fn default() -> TransformKindV2
fn default() -> TransformKindV2
Source§impl<'de> Deserialize<'de> for TransformKindV2
impl<'de> Deserialize<'de> for TransformKindV2
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromBytes for TransformKindV2
impl FromBytes for TransformKindV2
Source§impl JsonSchema for TransformKindV2
impl JsonSchema for TransformKindV2
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for TransformKindV2
impl PartialEq for TransformKindV2
Source§impl Serialize for TransformKindV2
impl Serialize for TransformKindV2
Source§impl ToBytes for TransformKindV2
impl ToBytes for TransformKindV2
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
Vec<u8> which would be returned from a successful call to
to_bytes() or into_bytes(). The data is not actually serialized, so this call is
relatively cheap.impl Eq for TransformKindV2
impl StructuralPartialEq for TransformKindV2
Auto Trait Implementations§
impl Freeze for TransformKindV2
impl RefUnwindSafe for TransformKindV2
impl Send for TransformKindV2
impl Sync for TransformKindV2
impl Unpin for TransformKindV2
impl UnwindSafe for TransformKindV2
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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