#configuration #provider #ad-hoc #figment

adhoc-figment

An ad hoc provider for figment

2 releases

0.1.1 Sep 10, 2021
0.1.0 Sep 7, 2021

#674 in Configuration

MIT license

5KB
68 lines

Ad Hoc Figment

An ad hoc provider for the figment configuration library.

use figment::Figment;
use adhoc_figment::AdHocProvider;

fn main() {
    let ad_hoc = AdHocProvider::new("key", "value");
    let figment = Figment::from(ad_hoc);
    let value: String = figment.extract_inner("key").unwrap();
    assert_eq!(value, "value");
}

Dependencies

~430–690KB
~12K SLoC