Source code
Revision control
Copy as Markdown
Other Tools
// @generated
# [doc = " Implement `DataProvider<DictionaryForWordLineExtendedV1Marker>` on the given struct using the data"] # [doc = r" hardcoded in this file. This allows the struct to be used with"] # [doc = r" `icu`'s `_unstable` constructors."] # [doc (hidden)] # [macro_export] macro_rules ! __impl_segmenter_dictionary_wl_ext_v1 { ($ provider : ty) => { # [clippy :: msrv = "1.67"] const _ : () = < $ provider > :: MUST_USE_MAKE_PROVIDER_MACRO ; # [clippy :: msrv = "1.67"] impl icu_provider :: DataProvider < icu::segmenter :: provider :: DictionaryForWordLineExtendedV1Marker > for $ provider { fn load (& self , req : icu_provider :: DataRequest ,) -> Result < icu_provider :: DataResponse < icu::segmenter :: provider :: DictionaryForWordLineExtendedV1Marker > , icu_provider :: DataError > { static KM : < icu::segmenter :: provider :: DictionaryForWordLineExtendedV1Marker as icu_provider :: DataMarker > :: Yokeable = icu::segmenter :: provider :: UCharDictionaryBreakDataV1 { trie_data : unsafe { zerovec :: ZeroVec :: from_bytes_unchecked (b"\0\0") } , } ; static VALUES : [& < icu::segmenter :: provider :: DictionaryForWordLineExtendedV1Marker as icu_provider :: DataMarker > :: Yokeable ; 4usize] = [& KM , & KM , & KM , & KM] ; static KEYS : [& str ; 4usize] = ["km" , "lo" , "my" , "th"] ; if let Ok (payload) = KEYS . binary_search_by (| k | req . locale . strict_cmp (k . as_bytes ()) . reverse ()) . map (| i | * unsafe { VALUES . get_unchecked (i) }) { Ok (icu_provider :: DataResponse { payload : Some (icu_provider :: DataPayload :: from_static_ref (payload)) , metadata : Default :: default () , }) } else { Err (icu_provider :: DataErrorKind :: MissingLocale . with_req (< icu::segmenter :: provider :: DictionaryForWordLineExtendedV1Marker as icu_provider :: KeyedDataMarker > :: KEY , req)) } } } } } # [doc = " Implement `IterableDataProvider<DictionaryForWordLineExtendedV1Marker>` on the given struct using the data"] # [doc = r" hardcoded in this file. This allows the struct to be used with"] # [doc = r" `DatagenDriver` for this key."] # [doc (hidden)] # [macro_export] macro_rules ! __impliterable_segmenter_dictionary_wl_ext_v1 { ($ provider : ty) => { # [clippy :: msrv = "1.67"] impl icu_provider :: datagen :: IterableDataProvider < icu::segmenter :: provider :: DictionaryForWordLineExtendedV1Marker > for $ provider { fn supported_locales (& self) -> Result < alloc :: vec :: Vec < icu_provider :: DataLocale > , icu_provider :: DataError > { Ok (["km" , "lo" , "my" , "th"] . into_iter () . map (| s | < icu_provider :: DataLocale as core :: str :: FromStr > :: from_str (s) . unwrap ()) . collect ()) } } } }