#![allow(clippy::exhaustive_structs, clippy::exhaustive_enums)]
use icu_collections::char16trie::Char16Trie;
use icu_collections::codepointtrie::CodePointTrie;
use icu_provider::{yoke, zerofrom};
use zerovec::ZeroVec;
#[icu_provider::data_struct(CanonicalDecompositionDataV1Marker = "normalizer/nfd@1")]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake), databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DecompositionDataV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u32>,
}
#[icu_provider::data_struct(
CompatibilityDecompositionSupplementV1Marker = "normalizer/nfkd@1",
Uts46DecompositionSupplementV1Marker = "normalizer/uts46d@1"
)]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake), databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DecompositionSupplementV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u32>,
pub flags: u8,
pub passthrough_cap: u16,
}
impl DecompositionSupplementV1<'_> {
const HALF_WIDTH_VOICING_MARK_MASK: u8 = 1;
pub fn half_width_voicing_marks_become_non_starters(&self) -> bool {
(self.flags & DecompositionSupplementV1::HALF_WIDTH_VOICING_MARK_MASK) != 0
}
}
#[icu_provider::data_struct(
CanonicalDecompositionTablesV1Marker = "normalizer/nfdex@1",
CompatibilityDecompositionTablesV1Marker = "normalizer/nfkdex@1"
)]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake), databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DecompositionTablesV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub scalars16: ZeroVec<'data, u16>,
#[cfg_attr(feature = "serde", serde(borrow))]
pub scalars24: ZeroVec<'data, char>,
}
#[icu_provider::data_struct(CanonicalCompositionsV1Marker = "normalizer/comp@1")]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake), databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct CanonicalCompositionsV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub canonical_compositions: Char16Trie<'data>,
}
#[icu_provider::data_struct(NonRecursiveDecompositionSupplementV1Marker = "normalizer/decomp@1")]
#[derive(Debug, PartialEq, Clone)]
#[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake), databake(path = icu_normalizer::provider))]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct NonRecursiveDecompositionSupplementV1<'data> {
#[cfg_attr(feature = "serde", serde(borrow))]
pub trie: CodePointTrie<'data, u32>,
#[cfg_attr(feature = "serde", serde(borrow))]
pub scalars24: ZeroVec<'data, char>,
}