Baguette generates session-typed Rust APIs for multiparty communication protocols. Given a per-role finite state machine in DOT format (as produced by ovenMPST), it generates a Rust source file where each protocol state is a distinct type and every method consumes self, returning a value of the next state's type. This encoding uses Rust's affine type system to reject programs that skip, repeat, or reorder protocol steps at compile time.
Messages are sent and received over ZeroMQ PUSH/PULL sockets via the included Transport type.
cargo run -- <input.dot> <output.rs>
The logging example runs three roles as threads in one process.
cargo run --example logging
The acquire_use_release example has two implementations. The threaded version runs all three roles in one process.
cargo run --example acquire_use_release
The multiprocess version runs each role as a separate executable. See examples/acquire_use_release/README.md for details.
bash examples/acquire_use_release/multiprocess/run.sh
See doc/manual.md for a detailed description of the protocol format, transport API, naming conventions, and how to add new protocols.
cargo build
cargo test