Flexweave
A book-style guide to deterministic mechanics primitives for Rust runtimes.
Flexweave is a domain-agnostic Rust crate for reusable mechanics building blocks. It owns deterministic primitive state and lifecycle shape while caller code owns game meaning, authored content, runtime behavior, and deployment.
This site is organized as a progressive guide. Start with the boundary model, then build a complete RPG combat runtime, then use the concept and pattern chapters to adapt the primitives to your own application.
The Reader Path
- Getting Started explains what Flexweave provides and where it stops.
- Building an RPG Combat Runtime walks through a cohesive example with a player, enemies, attributes, abilities, effects, buffs, lifecycle events, signals, and cleanup.
- Core Concepts explains the primitives behind the example.
- Runtime Patterns shows focused integration recipes for consumer apps.
- Design Notes explains the library boundaries and tradeoffs.
- API Reference is separate from the guide and covers the public library surface.
Main Example
The RPG combat chapters are backed by a compile-checked example in the Flexweave crate:
cargo run -p flexweave --example rpg_combatThe example is intentionally caller-owned code. Flexweave does not know what a player, enemy, slash, buff, cooldown, or combat log means. It supplies the primitive mechanics shape that the consumer runtime composes.