Struct VmState

Source
pub struct VmState<'a> {
Show 14 fields pub code: OwnedCellSlice, pub throw_on_code_access: bool, pub stack: SafeRc<Stack>, pub cr: ControlRegs, pub committed_state: Option<CommittedState>, pub steps: u64, pub quit0: SafeRc<QuitCont>, pub quit1: SafeRc<QuitCont>, pub gas: GasConsumer<'a>, pub cp: &'static DispatchTable, pub debug: Option<&'a mut dyn Write>, pub modifiers: BehaviourModifiers, pub version: VmVersion, pub parent: Option<Box<ParentVmState<'a>>>,
}
Expand description

Full execution state.

Fields§

§code: OwnedCellSlice§throw_on_code_access: bool§stack: SafeRc<Stack>§cr: ControlRegs§committed_state: Option<CommittedState>§steps: u64§quit0: SafeRc<QuitCont>§quit1: SafeRc<QuitCont>§gas: GasConsumer<'a>§cp: &'static DispatchTable§debug: Option<&'a mut dyn Write>§modifiers: BehaviourModifiers§version: VmVersion§parent: Option<Box<ParentVmState<'a>>>

Implementations§

Source§

impl<'a> VmState<'a>

Source

pub const DEFAULT_VERSION: VmVersion = VmVersion::LATEST_TON

Source

pub const MAX_DATA_DEPTH: u16 = 512u16

Source

pub fn builder() -> VmStateBuilder<'a>

Source

pub fn step(&mut self) -> VmResult<i32>

Source

pub fn run(&mut self) -> i32

Source

pub fn try_commit(&mut self) -> bool

Source

pub fn force_commit(&mut self) -> Result<(), Error>

Source

pub fn take_stack(&mut self) -> SafeRc<Stack>

Source

pub fn ref_to_cont(&mut self, code: Cell) -> VmResult<RcCont>

Source

pub fn c1_envelope_if(&mut self, cond: bool, cont: RcCont, save: bool) -> RcCont

Source

pub fn c1_envelope(&mut self, cont: RcCont, save: bool) -> RcCont

Source

pub fn c1_save_set(&mut self)

Source

pub fn extract_cc( &mut self, mode: SaveCr, stack_copy: Option<u16>, nargs: Option<u16>, ) -> VmResult<RcCont>

Source

pub fn throw_exception(&mut self, n: i32) -> VmResult<i32>

Source

pub fn throw_exception_with_arg( &mut self, n: i32, arg: RcStackValue, ) -> VmResult<i32>

Source

pub fn throw_out_of_gas(&mut self) -> i32

Source

pub fn call(&mut self, cont: RcCont) -> VmResult<i32>

Source

pub fn call_ext( &mut self, cont: RcCont, pass_args: Option<u16>, ret_args: Option<u16>, ) -> VmResult<i32>

Source

pub fn jump(&mut self, cont: RcCont) -> VmResult<i32>

Source

pub fn jump_ext( &mut self, cont: RcCont, pass_args: Option<u16>, ) -> VmResult<i32>

Source

pub fn ret(&mut self) -> VmResult<i32>

Source

pub fn ret_ext(&mut self, ret_args: Option<u16>) -> VmResult<i32>

Source

pub fn ret_alt(&mut self) -> VmResult<i32>

Source

pub fn ret_alt_ext(&mut self, ret_args: Option<u16>) -> VmResult<i32>

Source

pub fn repeat(&mut self, body: RcCont, after: RcCont, n: u32) -> VmResult<i32>

Source

pub fn until(&mut self, body: RcCont, after: RcCont) -> VmResult<i32>

Source

pub fn loop_while( &mut self, cond: RcCont, body: RcCont, after: RcCont, ) -> VmResult<i32>

Source

pub fn again(&mut self, body: RcCont) -> VmResult<i32>

Source

pub fn adjust_cr(&mut self, save: &ControlRegs)

Source

pub fn preclear_cr(&mut self, save: &ControlRegs)

Source

pub fn set_c0(&mut self, cont: RcCont)

Source

pub fn set_code(&mut self, code: OwnedCellSlice, cp: u16) -> VmResult<()>

Source

pub fn force_cp(&mut self, cp: u16) -> VmResult<()>

Auto Trait Implementations§

§

impl<'a> !Freeze for VmState<'a>

§

impl<'a> !RefUnwindSafe for VmState<'a>

§

impl<'a> !Send for VmState<'a>

§

impl<'a> !Sync for VmState<'a>

§

impl<'a> Unpin for VmState<'a>

§

impl<'a> !UnwindSafe for VmState<'a>

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> 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> SafeDelete for T
where T: 'static,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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

impl<T> EquivalentRepr<T> for T