fondant
Documentation · Architecture · Usage · Customization · Todo
fondant is a macro based library to take the boilerplate out of
configuration handling. All you need to do is derive the
Configure trait on your struct, and fondant will decide
where to store it and and how to do so safely.
Most of fondant is based off the confy crate,
with a couple of extra features:
- support for json, yaml and toml
- support for custom config paths
- support for custom config file names
Usage (Full Documentation)
Drop this in your Cargo.toml to get started:
[dependencies]
fondant = "0.1.0"
Derive the macro:
// the struct has to derive Serialize, Deserialize and Default
use Configure;
use ;
Find more examples and options at docs.rs.
Architecture
fondant is split into 3 separate crates:
fondant_deps: external crates and utils thatfondantrequiresfondant_derive: core macro definitionsfondant: the user facing library that brings it all together
This slightly strange architecture arose because of some
limitations with proc-macro crates and strict cyclic
dependencies in cargo. All you need is the fondant crate.
Todo
- improve error types
- use
syn::Errorandsyn::Resultto report macro errors - write docs
- write test suite
- bundle and publish to crates.io