diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 5882c3f76..04cb7010d 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -131,11 +131,26 @@ impl<'config> Runtime<'config> { } } + pub fn new_from_state(machine: Machine, context: Context, config: &'config Config) -> Self { + Self { + machine, + status: Ok(()), + return_data_buffer: Vec::new(), + context, + _config: config, + } + } + /// Get a reference to the machine. pub fn machine(&self) -> &Machine { &self.machine } + /// Get a reference to the machine. + pub fn machine_mut(&mut self) -> &mut Machine { + &mut self.machine + } + /// Get a reference to the execution context. pub fn context(&self) -> &Context { &self.context