conferencier
Minimal, easy-to-use typed TOML configuration for Tokio applications. Describe each application component's settings as a Rust struct, load them from TOML, and share them safely across async tasks. A derive and a few calls are all you need; there is no framework to learn and no hidden machinery.
Conferencier keeps configuration explicit and predictable:
- Derives map structs to TOML sections, nested tables and arrays of tables.
- Rust types, defaults and optional fields make configuration visible in application code.
- A store (
ConfigStore) holds the TOML document; each scope (a struct implementingConfigScope) copies data to or from it only when asked. Configuration is never reloaded or saved automatically. - Shared scopes (
SharedScope<T>) use Tokio locks, while the store's in-memory operations are synchronous.
Example
A web service can keep its listener settings in one typed scope:
use ;
async
request_count is runtime state: it starts at zero and is never read from or written to TOML. Hold a scope guard only for a short block; a single write guard keeps several related changes consistent for other readers. A real application would load its configuration file with ConfigStore::from_file(path).await? instead of from_str.
Add conferencier and Tokio to your project:
or to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["macros", "rt-multi-thread"] }
Typical use
- The application loads the user's TOML file into a
ConfigStoreand passes clones of this handle to its components. - Each component owns one or more sections. It describes each section with a struct deriving
ConfigScope, independent of the other components. Besides loaded settings, the struct can hold runtime fields such as counters, caches or client handles, which are never read from or written to TOML. - The component creates its
SharedScopewithfrom_storeand passes clones to its Tokio tasks. The tasks read and change the settings and share the runtime state through it. - To persist changes, the component saves its scope back to the store, which replaces only its section. Saving the store to a file writes the whole document, including the sections other components have saved.
- The file can be the original or another one. For example, an application can keep a hand-edited, commented TOML file as the out-of-the-box configuration and save its effective configuration to a separate file, which it loads instead when it exists. Conferencier does not choose between them; the application does.
Project scope
Conferencier supports TOML and uses Tokio for async operations. It does not layer configuration sources, watch files or validate application-specific rules. Saving a scope replaces its section; saving the store does not preserve comments or formatting. See saving configuration for details.
Status and compatibility
The 0.1.x API was introduced in 0.1.0-beta.1. Later 0.1.x versions remain
backward compatible with it; breaking changes are deferred to 0.2.0.
Rust 1.85 is supported throughout 0.1.x. When upgrading from 0.0.x, see the
migration guide.
The workspace uses Cargo resolver 3, which prefers dependency versions
compatible with Rust 1.85 when resolving a fresh lockfile.
If your project targets Rust 1.85, declare rust-version = "1.85" for its
packages and use Cargo resolver 3 (the default for an edition 2024 root
package; virtual workspaces must set it explicitly), or configure
resolver.incompatible-rust-versions = "fallback" in .cargo/config.toml.
Resolution prefers compatible versions but cannot guarantee that one exists.
Learn more
- Guide and API reference, including concepts, the derive attributes, and migration guides.
- Examples in the repository, and three runnable applications: an uptime monitor with configuration reload, a folder indexer that manages its own configuration, and a modular agent whose independent components own their configuration.
- Changelog for release history.
- Contributing and issue tracker.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.