pub struct NodeActor<T: TypedMachine> { /* private fields */ }Expand description
The actor behind an addon’s Actor class: a JsonActor with the
JavaScript side’s numbers and errors, retired by a panic.
Implementations§
Source§impl<T: TypedMachine> NodeActor<T>
impl<T: TypedMachine> NodeActor<T>
Sourcepub fn start(options: &str, now: f64) -> Result<Self>
pub fn start(options: &str, now: f64) -> Result<Self>
Starts an actor at now with the options of JsonActor::start.
Sourcepub fn restore(options: &str, snapshot: &str) -> Result<Self>
pub fn restore(options: &str, snapshot: &str) -> Result<Self>
Restores an actor from persist output with the options of
JsonActor::restore. Runs no actions.
Sourcepub fn send(&mut self, event: &str, now: f64) -> Result<()>
pub fn send(&mut self, event: &str, now: f64) -> Result<()>
Sends an event of the machine to the root at now (JsonActor::send).
Sourcepub fn send_to(&mut self, address: &str, event: &str, now: f64) -> Result<()>
pub fn send_to(&mut self, address: &str, event: &str, now: f64) -> Result<()>
Sends an event to any actor in the system by address (JsonActor::send_to).
Sourcepub fn next_deadline(&self) -> Result<Option<f64>>
pub fn next_deadline(&self) -> Result<Option<f64>>
When the next timer is due, in milliseconds.
Sourcepub fn snapshot(&self) -> Result<String>
pub fn snapshot(&self) -> Result<String>
The root’s snapshot (JsonActor::snapshot).
Sourcepub fn take_emitted(&mut self) -> Result<Vec<String>>
pub fn take_emitted(&mut self) -> Result<Vec<String>>
Events the root emitted since the last call, oldest first.
Sourcepub fn observe_system_emitted(&mut self) -> Result<()>
pub fn observe_system_emitted(&mut self) -> Result<()>
Collects the events every actor in the system emits from now on.
Sourcepub fn unobserve_system_emitted(&mut self) -> Result<()>
pub fn unobserve_system_emitted(&mut self) -> Result<()>
Stops collecting them and drops those not taken.
Sourcepub fn take_system_emitted(&mut self) -> Result<Vec<String>>
pub fn take_system_emitted(&mut self) -> Result<Vec<String>>
Events every actor emitted since the last call (JsonActor::take_system_emitted).
Sourcepub fn take_logs(&mut self) -> Result<Vec<String>>
pub fn take_logs(&mut self) -> Result<Vec<String>>
Argument lists of the root’s @xstate.log actions since the last call.
Sourcepub fn pending_effects(&self) -> Result<Vec<String>>
pub fn pending_effects(&self) -> Result<Vec<String>>
External work waiting for the host (XState’s external effect data).