icu_provider::dynutil

Macro impl_dynamic_data_provider

Source
macro_rules! impl_dynamic_data_provider {
    ($provider:ty, $arms:tt, $one:path, $($rest:path),+) => { ... };
    ($provider:ty, { $($ident:ident = $marker:path => $struct_m:ty),+, $(_ => $struct_d:ty,)?}, $dyn_m:ty) => { ... };
    ($provider:ty, [ $($(#[$cfg:meta])? $struct_m:ty),+, ], $dyn_m:path) => { ... };
}
Expand description

Implements DynamicDataProvider for a marker type S on a type that already implements DynamicDataProvider or DataProvider for one or more M, where M is a concrete type that is convertible to S via UpcastDataPayload.

§Wrapping DataProvider

If your type implements DataProvider, pass a list of markers as the second argument. This results in a DynamicDataProvider that delegates to a specific marker if the marker matches or else returns DataErrorKind::MarkerNotFound.