Debian Codegraph @

debian/rust-vendor/icu_segmenter/src/provider/complex/radical.rs

raw
1 // This file is part of ICU4X. For terms of use, please see the file
2 // called LICENSE at the top level of the ICU4X source tree
3 // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5 //! Data provider struct definitions for radicals.
6
7 use icu_collections::codepointtrie::CodePointTrie;
8 use icu_provider::prelude::*;
9
10 /// Data for Unihan radicals.
11 #[derive(Debug, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)]
12 #[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
13 #[cfg_attr(feature = "datagen", databake(path = icu_segmenter::provider))]
14 #[cfg_attr(feature = "serde", derive(serde::Deserialize))]
15 pub struct UnihanRadicalsData<'data> {
16 /// Trie mapping code points to their IRG source radical ID (u8).
17 #[cfg_attr(feature = "serde", serde(borrow))]
18 pub trie: CodePointTrie<'data, u8>,
19 }
20
21 icu_provider::data_struct!(
22 UnihanRadicalsData<'_>,
23 #[cfg(feature = "datagen")]
24 );