icu_locid_transform/provider/
mod.rs#![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)]
mod canonicalizer;
pub use canonicalizer::*;
use icu_locid::subtags::Language;
mod directionality;
pub use directionality::*;
mod expander;
pub use expander::*;
mod fallback;
pub use fallback::*;
#[cfg(feature = "compiled_data")]
#[derive(Debug)]
pub struct Baked;
#[cfg(feature = "compiled_data")]
const _: () = {
pub mod icu {
pub use crate as locid_transform;
pub use icu_locid as locid;
}
icu_locid_transform_data::make_provider!(Baked);
icu_locid_transform_data::impl_fallback_likelysubtags_v1!(Baked);
icu_locid_transform_data::impl_fallback_parents_v1!(Baked);
icu_locid_transform_data::impl_fallback_supplement_co_v1!(Baked);
icu_locid_transform_data::impl_locid_transform_aliases_v2!(Baked);
icu_locid_transform_data::impl_locid_transform_likelysubtags_ext_v1!(Baked);
icu_locid_transform_data::impl_locid_transform_likelysubtags_l_v1!(Baked);
icu_locid_transform_data::impl_locid_transform_likelysubtags_sr_v1!(Baked);
icu_locid_transform_data::impl_locid_transform_script_dir_v1!(Baked);
};
#[cfg(feature = "datagen")]
use icu_provider::prelude::*;
#[cfg(feature = "datagen")]
pub const KEYS: &[DataKey] = &[
AliasesV2Marker::KEY,
CollationFallbackSupplementV1Marker::KEY,
LikelySubtagsExtendedV1Marker::KEY,
LikelySubtagsForLanguageV1Marker::KEY,
LikelySubtagsForScriptRegionV1Marker::KEY,
LocaleFallbackLikelySubtagsV1Marker::KEY,
LocaleFallbackParentsV1Marker::KEY,
ScriptDirectionV1Marker::KEY,
];
use alloc::borrow::Cow;
use tinystr::{TinyAsciiStr, UnvalidatedTinyAsciiStr};
type UnvalidatedLanguage = UnvalidatedTinyAsciiStr<3>;
type UnvalidatedScript = UnvalidatedTinyAsciiStr<4>;
type UnvalidatedRegion = UnvalidatedTinyAsciiStr<3>;
type UnvalidatedVariant = UnvalidatedTinyAsciiStr<8>;
type UnvalidatedSubdivision = UnvalidatedTinyAsciiStr<7>;
type SemivalidatedSubdivision = TinyAsciiStr<7>;
type UnvalidatedLanguageIdentifier = str;
type UnvalidatedLanguageIdentifierPair = StrStrPairVarULE;
type UnvalidatedLanguageVariantsPair = LanguageStrStrPairVarULE;
#[zerovec::make_varule(StrStrPairVarULE)]
#[zerovec::derive(Debug)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize),
zerovec::derive(Deserialize)
)]
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
zerovec::derive(Serialize),
databake(path = icu_locid_transform::provider),
)]
pub struct StrStrPair<'a>(
#[cfg_attr(feature = "serde", serde(borrow))] pub Cow<'a, str>,
#[cfg_attr(feature = "serde", serde(borrow))] pub Cow<'a, str>,
);
#[zerovec::make_varule(LanguageStrStrPairVarULE)]
#[zerovec::derive(Debug)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde::Deserialize),
zerovec::derive(Deserialize)
)]
#[cfg_attr(
feature = "datagen",
derive(serde::Serialize, databake::Bake),
zerovec::derive(Serialize),
databake(path = icu_locid_transform::provider),
)]
pub struct LanguageStrStrPair<'a>(
pub Language,
#[cfg_attr(feature = "serde", serde(borrow))] pub Cow<'a, str>,
#[cfg_attr(feature = "serde", serde(borrow))] pub Cow<'a, str>,
);