use crate::provider::*;
use crate::sets::UnicodeSetData;
use crate::PropertiesError;
use icu_provider::prelude::*;
macro_rules! make_exemplar_chars_unicode_set_property {
(
// currently unused
marker: $marker_name:ident;
keyed_data_marker: $keyed_data_marker:ty;
func:
$(#[$attr:meta])*
$vis:vis fn $funcname:ident();
) => {
$(#[$attr])*
$vis fn $funcname(
provider: &(impl DataProvider<$keyed_data_marker> + ?Sized),
locale: &DataLocale,
) -> Result<UnicodeSetData, PropertiesError> {
Ok(provider.load(
DataRequest {
locale,
metadata: Default::default(),
})
.and_then(DataResponse::take_payload)
.map(UnicodeSetData::from_data)?
)
}
}
}
make_exemplar_chars_unicode_set_property!(
marker: ExemplarCharactersMain;
keyed_data_marker: ExemplarCharactersMainV1Marker;
func:
pub fn load_exemplars_main();
);
make_exemplar_chars_unicode_set_property!(
marker: ExemplarCharactersAuxiliary;
keyed_data_marker: ExemplarCharactersAuxiliaryV1Marker;
func:
pub fn load_exemplars_auxiliary();
);
make_exemplar_chars_unicode_set_property!(
marker: ExemplarCharactersPunctuation;
keyed_data_marker: ExemplarCharactersPunctuationV1Marker;
func:
pub fn load_exemplars_punctuation();
);
make_exemplar_chars_unicode_set_property!(
marker: ExemplarCharactersNumbers;
keyed_data_marker: ExemplarCharactersNumbersV1Marker;
func:
pub fn load_exemplars_numbers();
);
make_exemplar_chars_unicode_set_property!(
marker: ExemplarCharactersIndex;
keyed_data_marker: ExemplarCharactersIndexV1Marker;
func:
pub fn load_exemplars_index();
);