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
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
ThisTransientContains
Trait Implementations§
source§impl From<Access> for Constraint
impl From<Access> for Constraint
source§fn from(subgroup: Access) -> Constraint
fn from(subgroup: Access) -> Constraint
source§impl Ord for Access
impl Ord for Access
source§impl PartialEq for Access
impl PartialEq for Access
source§impl PartialOrd for Access
impl PartialOrd for Access
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl TryFromBytes for Access
impl TryFromBytes for Access
§type Error = FromBytesError
type Error = FromBytesError
impl Copy for Access
impl Eq for Access
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> 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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