Enum essential_constraint_vm::asm::Access

source ·
pub enum Access {
Show 19 variants DecisionVar, DecisionVarAt, DecisionVarRange, DecisionVarLen, State, StateRange, StateLen, StateLenRange, MutKeysLen, MutKeysContains, ThisAddress, ThisContractAddress, ThisPathway, RepeatCounter, Transient, TransientLen, PredicateAt, ThisTransientLen, ThisTransientContains,
}
Expand description

Operations for accessing input data.

Variants§

§

DecisionVar

0x30

Access the first word in a decision variable slot by slot.

The slot must be in range.

Returns a decision word.

§Stack Input

[slot]

§Stack Output

[decision_word]

§Panics
  • The slot is out of range.
  • If the slot is empty.
§

DecisionVarAt

0x31

Access a word in a decision variable slot by slot and index.

The slot and index must be in range.

Returns a decision word.

§Stack Input

[slot, index]

§Stack Output

[decision_word]

§Panics
  • The slot is out of range.
  • The index is out of range.
§

DecisionVarRange

0x32

Access a range of decision variables slot words starting from a specified slot and index.

Returns a list of decision words with length equal to the specified len.

§Stack Input

[slot, index, len]

§Stack Output

[decision_word, ...] The stack output length depends on the value of the range stack input word.

§Panics
  • The slot is out of range.
  • The range index..(index + len) is out of range.
§

DecisionVarLen

0x33

Get the length of a specified slot.

§Stack Input

[slot]

§Stack Output

[len]

§Panics
  • The slot is out of range.
§

State

0x34

Access a state variable by slot.

If the slot is empty, this is a noop.

The delta parameter determines if changes are considered.

Use StateLen to get the length of the state variable.

§Stack Input

[slot, delta]

§Stack Output

[state_slot_w0, ...state_slot_wN]

§Panics
  • The slot is out of range.
§

StateRange

0x35

Access a range of state variables starting from a specified slot.

Empty slots will not write anything to the stack.

The delta parameter determines if changes are considered.

Returns a list of state words with length equal to the specified range.

Use StateLenRange to get the lengths of the state variables.

§Stack Input

[slot, range, delta]

§Stack Output

[state_word_0, ...state_word_M, state_word_0, ...state_word_N, ...]

§Panics
  • The range slot..(slot + range) is out of range.
§

StateLen

0x36

Get the length of a state variable at a specified slot.

Returns a the length of the state variable.

§Stack Input

[slot, delta]

§Stack Output

[len]

§Panics
  • The slot is out of range.
§

StateLenRange

0x37

Get the lengths of a range of state variables starting from a specified slot.

Returns a list of lengths, each being the length of a state variable in the range.

§Stack Input

[slot, range, delta]

§Stack Output

[length, ...] The stack output length depends on the value of the range stack input word.

§Panics
  • The range slot..(slot + range) is out of range.
§

MutKeysLen

0x38

Get the number of mutable keys being proposed for mutation.

This operation returns a single word representing the length.

§Stack Output

[word]

§

MutKeysContains

0x39

Check if the mutable keys being proposed contain the given key.

This operation returns a true if the key is found, false otherwise.

§Stack Input

[key, key_len]

§Stack Output

[bool]

§

ThisAddress

0x3A

Get the content hash of this predicate.

This operation returns a list of words with a length of 4, representing the hash.

§Stack Output

[key]

§

ThisContractAddress

0x3B

Get the content hash of the contract this predicate belongs to.

This operation returns a list of words with a length of 4, representing the contract’s hash.

§Stack Output

[key]

§

ThisPathway

0x3C

Get the pathway of this predicate.

This operation returns the index of the solution data currently being used to check this predicate.

§Stack Output

[in]

§

RepeatCounter

0x3D

Access the top repeat counters current value.

§Stack Output

[counter_value]

§

Transient

0x3E

Get the solution data indexed by pathway and key.

§Stack Input

[key_0, ...key_N, key_len, pathway]

§Stack Output

[slot_word, ...] The stack output length depends on the value of the value_len stack input word.

§

TransientLen

0x3F

Get the length of solution data indexed by pathway and key.

§Stack Input

[key_0, ...key_N, key_len, pathway]

§Stack Output

[len]

§

PredicateAt

0x40

Get the predicate at solution data pathway.

§Stack Input

[pathway]

§Stack Output

[contract_key_0, contract_key_1, contract_key_2, contract_key_3, predicate_key_0, predicate_key_1, predicate_key_2, predicate_key_3]

§

ThisTransientLen

0x41

Get the length of the transient data at this predicate.

§Stack Output

[len]

§

ThisTransientContains

0x42

Check if the transient data at this predicate contains the given key.

§Stack Input

[key_0, ...key_N, key_len]

§Stack Output

[bool]

Trait Implementations§

source§

impl Clone for Access

source§

fn clone(&self) -> Access

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Access

source§

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

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

impl From<Access> for Constraint

source§

fn from(subgroup: Access) -> Constraint

Converts to this type from the input type.
source§

impl Hash for Access

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Access

source§

fn cmp(&self, other: &Access) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Access

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Access

source§

fn partial_cmp(&self, other: &Access) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl ToBytes for Access

§

type Bytes = Access

The iterator yielding bytes.
source§

fn to_bytes(&self) -> <Access as ToBytes>::Bytes

Convert the operation to its serialized form in bytes.
source§

impl ToOpcode for Access

§

type Opcode = Access

The associated Opcode type.
source§

fn to_opcode(&self) -> <Access as ToOpcode>::Opcode

The opcode associated with this operation.
source§

impl TryFromBytes for Access

§

type Error = FromBytesError

Represents any error that might occur while parsing an op from bytes.
source§

fn try_from_bytes( bytes: &mut impl Iterator<Item = u8>, ) -> Option<Result<Access, <Access as TryFromBytes>::Error>>

Parse a single operation from the given iterator yielding bytes. Read more
source§

impl Copy for Access

source§

impl Eq for Access

source§

impl StructuralPartialEq for Access

Auto Trait Implementations§

§

impl Freeze for Access

§

impl RefUnwindSafe for Access

§

impl Send for Access

§

impl Sync for Access

§

impl Unpin for Access

§

impl UnwindSafe for Access

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

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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.