Registry / config / twelf
library0.15.0rscratesunverified

Twelf is a configuration solution for Rust including 12-Factor support, designed with layers to configure different sources and formats using a proc macro.

# Cargo.toml [dependencies] twelf = "0.15.0"
INSTALL
IMPORT
SIG · TWELF
T
twelf
configrustv0.15.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

config
use twelf::config;

Define and load configuration with Twelf

use twelf::config; #[config] struct AppConfig { #[serde(default = "default_port")] port: u16, } fn default_port() -> u16 { 8080 } fn main() { let config = AppConfig::load().unwrap(); println!("Port: {}", config.port); }
Debug
Known issues
gotchaRequires serde and serde_derive for struct serialization.
fix
Add serde and serde_derive as dependencies with the 'derive' feature.
affects: >=0.15.0
Upgrade
Version history
0.15.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
50 hits · last 30 days
node
45
Resources
twelf — cargo add twelf · libregistry