pub struct VmContext<'ctx> {
pub witness: StateValue,
pub destructible_input: &'ctx [(Input, StateCell)],
pub immutable_input: &'ctx [StateValue],
pub destructible_output: &'ctx [StateCell],
pub immutable_output: &'ctx [StateData],
}
Expand description
Context object provided to the VM instance, containing references to the operation inputs and outputs.
Fields§
§witness: StateValue
Operation-level witness.
destructible_input: &'ctx [(Input, StateCell)]
Operation input consisting of the destructible (read-once) memory cells.
immutable_input: &'ctx [StateValue]
Operation input consisting of the immutable (read-only) memory cells.
destructible_output: &'ctx [StateCell]
Operation output defining new destructible (read-once) memory cells.
immutable_output: &'ctx [StateData]
Operation output defining new immutable (append-only) memory cells.
Implementations§
Source§impl VmContext<'_>
impl VmContext<'_>
Sourcepub fn state_value(&self, cat: IoCat, index: u16) -> Option<StateValue>
pub fn state_value(&self, cat: IoCat, index: u16) -> Option<StateValue>
Returns a state value from the provided category of operation inputs/outputs using the given
index
.
If the operation doesn’t contain input/output with the index, returns None
.
Sourcepub fn input_lock_aux(&self, index: u16) -> Option<StateValue>
pub fn input_lock_aux(&self, index: u16) -> Option<StateValue>
Returns a state value from the destructible input previous output auxiliary data.
Sourcepub fn input_witness(&self, index: u16) -> Option<StateValue>
pub fn input_witness(&self, index: u16) -> Option<StateValue>
Returns a state value from the destructible input witness.
Trait Implementations§
impl<'ctx> Eq for VmContext<'ctx>
impl<'ctx> StructuralPartialEq for VmContext<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for VmContext<'ctx>
impl<'ctx> RefUnwindSafe for VmContext<'ctx>
impl<'ctx> Send for VmContext<'ctx>
impl<'ctx> Sync for VmContext<'ctx>
impl<'ctx> Unpin for VmContext<'ctx>
impl<'ctx> UnwindSafe for VmContext<'ctx>
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.