Skip to main content

all

Function all 

Source
pub fn all<A, B>(a: Config<A>, b: Config<B>) -> Config<(A, B)>
where A: Send + Sync + 'static, B: Send + Sync + 'static,
Expand description

Combine two configs into a tuple (Effect Config.all / Config.zip).

Both are loaded; the first error encountered is returned.

use id_effect_config::{config, Config, MapConfigProvider};

let p = MapConfigProvider::from_pairs([("HOST", "0.0.0.0"), ("PORT", "9000")]);
let (host, port) = config::all(Config::string("HOST"), Config::integer("PORT"))
  .load(&p)
  .unwrap();
assert_eq!(host, "0.0.0.0");
assert_eq!(port, 9000);