// @generated /// Implement `DataProvider` on the given struct using the data /// hardcoded in this file. This allows the struct to be used with /// `icu`'s `_unstable` constructors. /// /// Using this implementation will embed the following data in the binary's data segment: /// * 133B for the lookup data structure (26 data identifiers) /// * 524B[^1] for the actual data (10 unique structs) /// /// [^1]: these numbers can be smaller in practice due to linker deduplication #[doc(hidden)] #[macro_export] macro_rules! __impl_plural_ranges_v1_marker { ($ provider : ty) => { #[clippy::msrv = "1.71.1"] const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO; #[clippy::msrv = "1.71.1"] impl $provider { const DATA_PLURAL_RANGES_V1_MARKER: icu_provider_baked::zerotrie::Data = icu_provider_baked::zerotrie::Data { trie: icu_provider_baked::zerotrie::ZeroTrieSimpleAscii { store: b"\xD0abcefhiklmnoprsu\t\x0B\r\x19\x1F!#%')+-02>\xC3fkr\x01\x02\x80\x81\x82g\x80a\x80\xC4nstu\x01\x02\x03\x80\x80\x80\x80\xC2ai\x01\x81\x80e\x83a\x80a\x84v\x85k\x86o\x80r\x81cm\x80o\x87\xC4dilv\x01\x02\x03\x81\x80\x88\x80\xC2nr\x02d\x89\x80" }, values: &[ icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\"") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\x03\x12\x13#") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\x01\x01\0") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\x03#") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\0") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02 ") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\x02") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\x11!") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0\0") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\"") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\0") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"B") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x04") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\"2B") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x04\x04\x04\x04") }) }, }, icu::plurals::provider::PluralRangesV1 { ranges: unsafe { #[allow(unused_unsafe)] zerovec::ZeroMap::from_parts_unchecked(zerovec::ZeroVec::new(), zerovec::ZeroVec::new()) }, }, ], }; } #[clippy::msrv = "1.71.1"] impl icu_provider::DataProvider for $provider { fn load(&self, req: icu_provider::DataRequest) -> Result, icu_provider::DataError> { let mut metadata = icu_provider::DataResponseMetadata::default(); let payload = if let Some(payload) = icu_provider_baked::DataStore::get(&Self::DATA_PLURAL_RANGES_V1_MARKER, req.id, req.metadata.attributes_prefix_match) { payload } else { const FALLBACKER: icu::locale::fallback::LocaleFallbackerWithConfig<'static> = icu::locale::fallback::LocaleFallbacker::new().for_config(::INFO.fallback_config); let mut fallback_iterator = FALLBACKER.fallback_for(req.id.locale.clone()); loop { if let Some(payload) = icu_provider_baked::DataStore::get(&Self::DATA_PLURAL_RANGES_V1_MARKER, icu_provider::DataIdentifierBorrowed::for_marker_attributes_and_locale(req.id.marker_attributes, fallback_iterator.get()), req.metadata.attributes_prefix_match) { metadata.locale = Some(fallback_iterator.take()); break payload; } if fallback_iterator.get().is_default() { return Err(icu_provider::DataErrorKind::IdentifierNotFound.with_req(::INFO, req)); } fallback_iterator.step(); } }; Ok(icu_provider::DataResponse { payload: icu_provider::DataPayload::from_static_ref(payload), metadata }) } } }; ($ provider : ty , ITER) => { __impl_plural_ranges_v1_marker!($provider); #[clippy::msrv = "1.71.1"] impl icu_provider::IterableDataProvider for $provider { fn iter_ids(&self) -> Result>, icu_provider::DataError> { Ok(icu_provider_baked::DataStore::iter(&Self::DATA_PLURAL_RANGES_V1_MARKER).collect()) } } }; ($ provider : ty , DRY) => {}; ($ provider : ty , DRY , ITER) => { __impl_plural_ranges_v1_marker!($provider, ITER); }; } #[doc(inline)] pub use __impl_plural_ranges_v1_marker as impl_plural_ranges_v1_marker;