pub enum Access {
ThisAddress,
ThisContractAddress,
MutKeys,
RepeatCounter,
DecisionVar,
DecisionVarLen,
State,
StateLen,
NumSlots,
PredicateExists,
}
Expand description
Operations for accessing input data.
Variants§
ThisAddress
0x30
: THIS
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
0x31
: THISC
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]
MutKeys
0x34
: MKEYS
Push the keys of the proposed state mutations onto the stack.
Note the order is non-deterministic because this is a set.
Returns only total length 0 if there are no mutations.
§Stack Output
[key_0, key_0_len, ...key_N, key_N_len, total_length]
RepeatCounter
DecisionVar
0x37
: VAR
Access a range of len
words starting from value_ix
within the decision variable located at slot_ix
.
Returns a list of decision words with length equal to the specified len.
§Stack Input
[slot_ix, value_ix, len]
§Stack Output
[word, ...]
The stack output length depends on the value of the len
stack input word.
§Panics
- slot_ix is out of range.
- The range
value_ix..(value_ix + len)
is out of range.
DecisionVarLen
0x38
: VLEN
Get the length of a the decision variable value located at slot_ix
.
§Stack Input
[slot_ix]
§Stack Output
[len]
§Panics
- slot_ix is out of range.
State
0x39
Access a range of words from the state value located in the slot at slot_ix
.
Push len
words from the value onto the stack, starting from the word at value_ix
.
The argument delta false
accesses pre state.
The argument delta true
accesses post state.
§Stack Input
[slot_ix, value_ix, len, delta]
§Stack Output
[word, ...]
The stack output length depends on the value of the len
stack input word.
§Panics
- slot_ix is out of range.
- The range
value_ix..(value_ix + len)
is out of range. - delta is not a boolean.
StateLen
0x3A
: SLEN
Get the length of a state value at a specified slot_ix
.
The argument delta false
accesses pre state.
The argument delta true
accesses post state.
Returns the length of the state value.
§Stack Input
[slot_ix, delta]
§Stack Output
[len]
§Panics
- slot_ix is out of range.
- delta is not a boolean.
NumSlots
0x3B
: NSLT
Get the number of decision var or state slots.
which_slots
:
-
0
for decision vars. -
1
for pre state slots. -
2
for post state slots.
§Stack Input
[which_slots]
§Stack Output
[len]
PredicateExists
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 PartialOrd for Access
impl PartialOrd for Access
Source§impl TryFromBytes for Access
impl TryFromBytes for Access
Source§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§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