icu_collator_data 2.2.0

Data for the icu_collator crate
Documentation
// @generated
/// Implement `DataProvider<CollationDiacriticsV1>` 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:
/// * 51B for the lookup data structure (4 data identifiers)
/// * 546B[^1] for the actual data (3 unique structs)
///
/// [^1]: these numbers can be smaller in practice due to linker deduplication
///
/// This macro requires the following crates:
/// * `icu`
/// * `icu_provider`
/// * `icu_provider/baked`
/// * `zerovec`
#[doc(hidden)]
#[macro_export]
macro_rules! __impl_collation_diacritics_v1 {
    ($ provider : ty) => {
        #[clippy::msrv = "1.86"]
        const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO;
        #[clippy::msrv = "1.86"]
        impl $provider {
            const DATA_COLLATION_DIACRITICS_V1: icu_provider::baked::zerotrie::Data<icu::collator::provider::CollationDiacriticsV1> = {
                const TRIE: icu_provider::baked::zerotrie::ZeroTrieSimpleAscii<&'static [u8]> = icu_provider::baked::zerotrie::ZeroTrieSimpleAscii { store: b"\xC3euv\x02\x05e\x80nd\x81i\x82\x1Etrad\x82" };
                const VALUES: &'static [<icu::collator::provider::CollationDiacriticsV1 as icu_provider::baked::zerotrie::DynamicDataMarker>::DataStruct] = &[icu::collator::provider::CollationDiacritics { secondaries: unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\x8A\0\x88\0\x91\0\x9A\0\xA4\0\xB4\0\x8C\0\x9C\0\x96\0\xB6\0\x92\0\x98\0\x90\0\xA6\0\xA6\0\xB8\0\xBA\0\xBC\0\xA6\0\x84\0\x86\0\xA6\0\xA8\0\xA8\0\xA8\0\xA8\0\xA6\0\xBE\0\xA8\0\xA8\0\xA8\0\xA8\0\xA8\0\xC0\0\xC2\0\xC4\0\xC6\0\xC8\0\xCA\0\xA0\0\xA2\0\xA8\0\xA8\0\xA8\0\xA8\0\xCC\0\xCE\0\xA8\0\xD0\0\xD2\0\x82\0\xA8\0\xD4\0\xB2\0\xAA\0\xAA\0\x9E\0\xD6\0\xA8\0\xA8\0\xA8\0\xA6\0\xA6\0\xA6\0\0\0\0\0\x94\0\0\0\0\0\xD8\0\xA6\0\xA8\0\xA8\0\xA8\0\xA6\0\xA6\0\xA6\0\xA8\0\xA8") } }, icu::collator::provider::CollationDiacritics { secondaries: unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\x8A\0\x88\0\x8E\0\x9A\0\xA4\0\xB4\0\x8C\0\x9C\0\x96\0\xB6\0\x92\0\x98\0\x90\0\xA6\0\xA6\0\xB8\0\xBA\0\xBC\0\xA6\0\x84\0\x86\0\xA6\0\xA8\0\xA8\0\xA8\0\xA8\0\xA6\0\xBE\0\xA8\0\xA8\0\xA8\0\xA8\0\xA8\0\xC0\0\xC2\0\xC4\0\xC6\0\xC8\0\xCA\0\xA0\0\xA2\0\xA8\0\xA8\0\xA8\0\xA8\0\xCC\0\xCE\0\xA8\0\xD0\0\xD2\0\x82\0\xA8\0\xD4\0\xB2\0\xAA\0\xAA\0\x9E\0\xD6\0\xA8\0\xA8\0\xA8\0\xA6\0\xA6\0\xA6\0\0\0\0\0\x94\0\0\0\0\0\xD8\0\xA6\0\xA8\0\xA8\0\xA8\0\xA6\0\xA6\0\xA6\0\xA8\0\xA8") } }, icu::collator::provider::CollationDiacritics { secondaries: unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\0\x8A\x04\x8B\0\x8E\x03\x8B\0\xA4\0\xB4\0\x8C\0\x9C\0\x96\x02\x8B\0\x92\0\x98\0\x90\0\xA6\0\xA6\0\xB8\0\xBA\0\xBC\0\xA6\0\x84\0\x86\0\xA6\0\xA8\0\xA8\0\xA8\0\xA8\0\xA6\0\xBE\0\xA8\0\xA8\0\xA8\0\xA8\0\xA8\0\xC0\0\xC2\x05\x8B\0\xC6\0\xC8\0\xCA\0\xA0\0\xA2\0\xA8\0\xA8\0\xA8\0\xA8\0\xCC\0\xCE\0\xA8\0\xD0\0\xD2\0\x82\0\xA8\0\xD4\0\xB2\0\xAA\0\xAA\0\x9E\0\xD6\0\xA8\0\xA8\0\xA8\0\xA6\0\xA6\0\xA6\0\0\0\0\0\x94\0\0\0\0\0\xD8\0\xA6\0\xA8\0\xA8\0\xA8\0\xA6\0\xA6\0\xA6\0\xA8\0\xA8") } }];
                unsafe { icu_provider::baked::zerotrie::Data::from_trie_and_values_unchecked(TRIE, VALUES) }
            };
        }
        #[clippy::msrv = "1.86"]
        impl icu_provider::DataProvider<icu::collator::provider::CollationDiacriticsV1> for $provider {
            fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu::collator::provider::CollationDiacriticsV1>, icu_provider::DataError> {
                let mut metadata = icu_provider::DataResponseMetadata::default();
                let payload = if let Some(payload) = icu_provider::baked::DataStore::get(&Self::DATA_COLLATION_DIACRITICS_V1, req.id, req.metadata.attributes_prefix_match) {
                    payload
                } else {
                    const FALLBACKER: icu::locale::fallback::LocaleFallbackerWithConfig<'static> = icu::locale::fallback::LocaleFallbacker::new().for_config(<icu::collator::provider::CollationDiacriticsV1 as icu_provider::DataMarker>::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_COLLATION_DIACRITICS_V1, 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_unknown() {
                            return Err(icu_provider::DataErrorKind::IdentifierNotFound.with_req(<icu::collator::provider::CollationDiacriticsV1 as icu_provider::DataMarker>::INFO, req));
                        }
                        fallback_iterator.step();
                    }
                };
                Ok(icu_provider::DataResponse { payload, metadata })
            }
        }
    };
    ($ provider : ty , ITER) => {
        __impl_collation_diacritics_v1!($provider);
        #[clippy::msrv = "1.86"]
        impl icu_provider::IterableDataProvider<icu::collator::provider::CollationDiacriticsV1> for $provider {
            fn iter_ids(&self) -> Result<std::collections::BTreeSet<icu_provider::DataIdentifierCow<'static>>, icu_provider::DataError> {
                Ok(icu_provider::baked::DataStore::iter(&Self::DATA_COLLATION_DIACRITICS_V1).collect())
            }
        }
    };
    ($ provider : ty , DRY) => {};
    ($ provider : ty , DRY , ITER) => {
        __impl_collation_diacritics_v1!($provider, ITER);
    };
}
#[doc(inline)]
pub use __impl_collation_diacritics_v1 as impl_collation_diacritics_v1;