macro_rules! make_forking_provider { ($combo_p:path, [ $a:expr, $b:expr, ]) => { ... }; ($combo_p:path, [ $a:expr, $b:expr, $($c:expr),+, ]) => { ... }; }
Expand description
Make a forking data provider with an arbitrary number of inner providers that are known at build time.
§Examples
use icu_provider_adapters::fork::ForkByKeyProvider;
// Some empty example providers:
#[derive(PartialEq, Debug)]
struct Provider1;
#[derive(PartialEq, Debug)]
struct Provider2;
#[derive(PartialEq, Debug)]
struct Provider3;
// Combine them into one:
let forking1 = icu_provider_adapters::make_forking_provider!(
ForkByKeyProvider::new,
[Provider1, Provider2, Provider3,]
);
// This is equivalent to:
let forking2 = ForkByKeyProvider::new(
Provider1,
ForkByKeyProvider::new(Provider2, Provider3),
);
assert_eq!(forking1, forking2);