Skip to main content

NodeMachine

Struct NodeMachine 

Source
pub struct NodeMachine<T: TypedMachine> { /* private fields */ }
Expand description

The machine behind an addon’s Machine class: a JsonMachine, the machine compiled once per addon with the load options of this object.

Implementations§

Source§

impl<T: TypedMachine> NodeMachine<T>

Source

pub fn load(env: &Env, options: &str) -> Result<Self>

The compiled machine with the load options of JsonMachine::load. A load that fails is an error whose code is the contract’s: WORKFLOW_INVALID_INPUT of options that do not parse, WORKFLOW_INVALID_MACHINE of a machine that does not compile.

Source

pub fn start(&self, env: &Env, options: &str, now: f64) -> Result<NodeActor<T>>

Starts an actor at now with the options of JsonMachine::start. A start that fails is an error whose code is the contract’s, WORKFLOW_MACHINE_FAILED of a root that failed as it started, and whose message is the error’s.

Source

pub fn restore(&self, env: &Env, snapshot: &str) -> Result<NodeActor<T>>

Restores an actor from persist output (JsonMachine::restore). Runs no actions. A snapshot that does not restore is an error whose code is WORKFLOW_INVALID_SNAPSHOT.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for NodeMachine<T>

§

impl<T> !UnwindSafe for NodeMachine<T>

§

impl<T> Forget for NodeMachine<T>

§

impl<T> Freeze for NodeMachine<T>

§

impl<T> Move for NodeMachine<T>

§

impl<T> Send for NodeMachine<T>
where Arc<Machine<<T as TypedMachine>::Context, <T as TypedMachine>::Event>>: Send, RawTable<usize>: Send, RawVecInner: Send,

§

impl<T> Sync for NodeMachine<T>
where Arc<Machine<<T as TypedMachine>::Context, <T as TypedMachine>::Event>>: Sync, RawTable<usize>: Sync, RawVecInner: Sync,

§

impl<T> Unpin for NodeMachine<T>
where Arc<Machine<<T as TypedMachine>::Context, <T as TypedMachine>::Event>>: Unpin, *const u8 is !null: Unpin,

§

impl<T> UnsafeUnpin for NodeMachine<T>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.