Expand description
§Gust Runtime
The runtime support library for compiled Gust state machine programs.
When the Gust compiler generates Rust code from .gu source files, the
generated code depends on this crate for core traits and utilities.
Generated modules typically begin with use gust_runtime::prelude::*;
to bring all necessary items into scope.
§What this crate provides
prelude::Machine– the base trait every generated state machine implements, providing state inspection and JSON serialization.prelude::Supervisorandprelude::SupervisorRuntime– structured concurrency primitives for running multiple child machines under a supervision tree, with configurable restart strategies.prelude::Envelope– a typed message wrapper for cross-machine communication.prelude::SupervisorActionandprelude::RestartStrategy– enums that control how failures propagate and which children are restarted.
§Re-exports
The prelude also re-exports serde, serde_json, and thiserror so
that generated code does not need to declare these as direct dependencies.
§Usage
You normally do not depend on this crate directly. Instead, the Gust
compiler adds it to your generated code automatically. If you need to
interact with generated machines from hand-written Rust, add the dependency
to your Cargo.toml:
[dependencies]
gust-runtime = "0.1"Modules§
- prelude
- Re-exports of the runtime traits and types that generated Gust code
relies on. Generated
.g.rsfilesuse gust_runtime::prelude::*;to bringMachine,Supervisor,Envelope,RestartStrategy, and third-party re-exports (serde,serde_json,thiserror) into scope.