
plotline
Branching sequences of events as plain data — dialog, quests, cutscenes,
tutorials — for any engine. The host defines the steps; plotline runs
order, branches, subroutines, jumps, and waits.
Quick start
[]
= "0.2"
use Poll;
use ;
let ready = new;
let waiting_on = ready.clone;
let mut library = new;
let farewell = library.insert;
let greeting = library.insert;
let mut runner = default;
let mut services = new;
runner.start.unwrap;
assert_eq!;
ready.signal;
assert_eq!;
Why
- Plain data. A sequence is an ordered list of steps the host defines — closures for the simple cases, structs where a step carries state.
- Subroutines and jumps.
Callenters a subroutine and falling off its end returns to the caller;Returnexits early;Gotoclears the whole call chain before starting its target. - No clock. A waiting step returns a
Completionhandle. The host signals it and callsadvance(). The crate does not define timed waits. - No engine or runtime dependencies.
no_stdwithalloc; the defaultstdfeature adds panic isolation only. - Tooling-ready. Whole-library validation, per-step reference facts, and reachability analysis feed editors and linters.
Requirements and features
- Rust 1.85 or later, edition 2024.
no_stdwithalloc; no required dependencies.std(default): catches panics in steps. It requirespanic = "unwind".--no-default-featuresbuilds withoutstdand does not catch panics.
More examples and documentation
- API documentation — rustdoc is the manual: steps, built-ins, validation, analysis, and diagnostics.
examples/dialog.rs— run it withcargo run --example dialog.- CHANGELOG
- Issue tracker
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Banner artwork: “Subway” (1934) by Lily Furedi, via Wikimedia Commons. The digital image is credited to the Smithsonian American Art Museum; the file is marked public domain.