API Reference
Every public type, trait, and function has full rustdoc. Two places to read it:
- This site, under
/api/bubbles/- built from the same commit as the guide you’re reading. - docs.rs - rebuilt on every crate release (crates.io package bubbles-dialogue, documented API crate bubbles).
Start there for the authoritative signatures, trait definitions, and error types. The guide points into specific pages as you go.
High-traffic items
A quick index of what you’ll look up most often:
| What you want | Where to look |
|---|---|
| Compile a script | compile, compile_many |
| Drive a dialogue | Runner, DialogueEvent |
| Store variables | VariableStorage, HashMapStorage |
| Localise lines | LineProvider, HashMapProvider |
| Register host functions | FunctionLibrary |
| Pick variants | SaliencyStrategy, FirstAvailable, BestLeastRecentlyViewed |
| Inline markup spans | MarkupSpan |
| Save / load | RunnerSnapshot, Runner::snapshot / restore (serde only for Serialize/Deserialize on the snapshot) |
| Handle errors | DialogueError |
| Unity / C# / C shared library | Not on docs.rs: see the guide chapter and the C header |
Feature flags
| Flag | Default | Enables |
|---|---|---|
rand | on | random, random_range, dice, RandomAvailable |
serde | off | Serialize/Deserialize on Value, HashMapStorage, RunnerSnapshot |
full | off | Both rand and serde together |
Still not sure?
- Search the guide (top-right) for keywords like “once”, “option”, “localisation”.
- Jump into the examples - they cover most of the API in under 200 lines each.
- Open an issue if something’s unclear. Documentation gaps are bugs.