Source code
Revision control
Copy as Markdown
Other Tools
// @generated
# [doc = " Implement `DataProvider<CollationSpecialPrimariesV1>` on the given struct using the data\n hardcoded in this file. This allows the struct to be used with\n `icu`'s `_unstable` constructors.\n\n Using this implementation will embed the following data in the binary's data segment:\n * 72B[^1] for the singleton data struct\n \n [^1]: these numbers can be smaller in practice due to linker deduplication\n\n This macro requires the following crates:\n * `icu`\n * `icu_provider`\n * `zerovec`\n"] # [doc (hidden)] # [macro_export] macro_rules ! __impl_collation_special_primaries_v1 { ($ provider : ty) => { # [clippy :: msrv = "1.86"] const _ : () = < $ provider > :: MUST_USE_MAKE_PROVIDER_MACRO ; # [clippy :: msrv = "1.86"] impl $ provider { # [doc (hidden)] pub const SINGLETON_COLLATION_SPECIAL_PRIMARIES_V1 : & 'static < icu :: collator :: provider :: CollationSpecialPrimariesV1 as icu_provider :: DynamicDataMarker > :: DataStruct = & icu :: collator :: provider :: CollationSpecialPrimaries { last_primaries : unsafe { zerovec :: ZeroVec :: from_bytes_unchecked (b"\x06\x05\0\x0C\xA3\r\0\x0F\0\0\0\0\0\0\0\0\0\0\0\0\xFE\xFF\xFF\xFF\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0@") } , numeric_primary : 16u8 , } ; } # [clippy :: msrv = "1.86"] impl icu_provider :: DataProvider < icu :: collator :: provider :: CollationSpecialPrimariesV1 > for $ provider { fn load (& self , req : icu_provider :: DataRequest ,) -> Result < icu_provider :: DataResponse < icu :: collator :: provider :: CollationSpecialPrimariesV1 > , icu_provider :: DataError > { if req . id . locale . is_unknown () { Ok (icu_provider :: DataResponse { payload : icu_provider :: DataPayload :: from_static_ref (Self :: SINGLETON_COLLATION_SPECIAL_PRIMARIES_V1) , metadata : icu_provider :: DataResponseMetadata :: default () , }) } else { Err (icu_provider :: DataErrorKind :: InvalidRequest . with_req (< icu :: collator :: provider :: CollationSpecialPrimariesV1 as icu_provider :: DataMarker > :: INFO , req)) } } } } ; ($ provider : ty , ITER) => { __impl_collation_special_primaries_v1 ! ($ provider) ; # [clippy :: msrv = "1.86"] impl icu_provider :: IterableDataProvider < icu :: collator :: provider :: CollationSpecialPrimariesV1 > for $ provider { fn iter_ids (& self) -> Result < std :: collections :: BtreeSet < icu_provider :: DataIdentifierCow < 'static >> , icu_provider :: DataError > { Ok ([Default :: default ()] . into_iter () . collect ()) } } } ; ($ provider : ty , DRY) => { __impl_collation_special_primaries_v1 ! ($ provider) ; # [clippy :: msrv = "1.86"] impl icu_provider :: DryDataProvider < icu :: collator :: provider :: CollationSpecialPrimariesV1 > for $ provider { fn dry_load (& self , req : icu_provider :: DataRequest) -> Result < icu_provider :: DataResponseMetadata , icu_provider :: DataError > { if req . id . locale . is_unknown () { Ok (icu_provider :: DataResponseMetadata :: default ()) } else { Err (icu_provider :: DataErrorKind :: InvalidRequest . with_req (< icu :: collator :: provider :: CollationSpecialPrimariesV1 as icu_provider :: DataMarker > :: INFO , req)) } } } } ; ($ provider : ty , DRY , ITER) => { __impl_collation_special_primaries_v1 ! ($ provider) ; # [clippy :: msrv = "1.86"] impl icu_provider :: DryDataProvider < icu :: collator :: provider :: CollationSpecialPrimariesV1 > for $ provider { fn dry_load (& self , req : icu_provider :: DataRequest) -> Result < icu_provider :: DataResponseMetadata , icu_provider :: DataError > { if req . id . locale . is_unknown () { Ok (icu_provider :: DataResponseMetadata :: default ()) } else { Err (icu_provider :: DataErrorKind :: InvalidRequest . with_req (< icu :: collator :: provider :: CollationSpecialPrimariesV1 as icu_provider :: DataMarker > :: INFO , req)) } } } # [clippy :: msrv = "1.86"] impl icu_provider :: IterableDataProvider < icu :: collator :: provider :: CollationSpecialPrimariesV1 > for $ provider { fn iter_ids (& self) -> Result < std :: collections :: BtreeSet < icu_provider :: DataIdentifierCow < 'static >> , icu_provider :: DataError > { Ok ([Default :: default ()] . into_iter () . collect ()) } } } ; } # [doc (inline)] pub use __impl_collation_special_primaries_v1 as impl_collation_special_primaries_v1 ;