Expand description
Sessions and the pure start and step functions (W3C SCXML Appendix D, interpret and
mainEventLoop).
A Session is a value: the configuration as a bitset over states in document order, the
history table, the internal queue, active invocations, the send and invoke counters, the
late-binding status of data items and the options. start and step take a session (or
create one) and an Input, and return the next session, the Effects to perform and a
MacrostepTrace. They perform no I/O, read no clock and use no randomness; delays are
durations inside effects and the time and seed of each input reach the datamodel only through
Datamodel::set_environment.
The datamodel is the one mutable component kept outside the value (decision D1); it is passed
as &mut dyn Datamodel. Executable content and condition evaluation live in this module and
call it; the transition selection and entry/exit computations are delegated to the
trait-object-free crate::kernel.
Structs§
- Input
- One input to
step: an external event or a cancel request, plus its environment. - Invocation
- A started invocation.
- Invoke
Request - A request to start an invocation, produced at the end of a macrostep.
- Options
- Interpreter options, fixed at session start.
- Outcome
- The result of a macrostep.
- Send
Request - A request to deliver an event, produced by
<send>. - Session
- The state of one session, as a value.
- Start
Input - The input that starts a session.
Enums§
- Effect
- An interaction with the outside world, returned by the step instead of performed.
- Input
Kind - What an input asks the session to do.
- Start
Error - Why a session could not start.
- Status
- Whether the session still accepts events.
- Step
Error - Why a step was rejected or cut short.
Constants§
- COMMUNICATION_
ERROR_ MESSAGE - Message of an
error.communicationfor a target the core knows is unreachable. - DEFAULT_
MICROSTEP_ BUDGET - The default number of microsteps one macrostep may take before it is cut off.
- EXECUTION_
ERROR_ MESSAGE - Message of an
error.executionthe core raises itself, not from a datamodel failure. - SCXML_
EVENT_ PROCESSOR - The type URI of the SCXML Event I/O Processor.
- SCXML_
INVOKE_ TYPE - The type URI of SCXML invocations.
Functions§
- parse_
delay - Parse a CSS2 time (
5s,250ms,1.5s, or a bare number of milliseconds) into milliseconds, without floating point. - start
- Start a session: initialize the datamodel (all data under early binding, top-level data under
late binding), run the top-level script, enter the initial configuration and run macrosteps
until stable.
dmmust be a fresh instance of the datamodel the chart names. - step
- Process one input: run one macrostep for an external event, or terminate on a cancel request. Equal sessions, inputs and datamodel states give equal results.