Debian Codegraph @

debian/rust-vendor/icu_segmenter/src/provider/complex/dictionary.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 use icu_provider::prelude::*;
6 use zerovec::ZeroVec;
7
8 /// char16trie data for dictionary break
9 ///
10 /// <div class="stab unstable">
11 /// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
12 /// including in SemVer minor releases. While the serde representation of data structs is guaranteed
13 /// to be stable, their Rust representation might not be. Use with caution.
14 /// </div>
15 #[derive(Debug, PartialEq, Clone, yoke::Yokeable, zerofrom::ZeroFrom)]
16 #[cfg_attr(feature = "datagen", derive(serde::Serialize, databake::Bake))]
17 #[cfg_attr(feature = "datagen", databake(path = icu_segmenter::provider))]
18 #[cfg_attr(feature = "serde", derive(serde::Deserialize))]
19 pub struct UCharDictionaryBreakData<'data> {
20 /// Dictionary data of char16trie.
21 #[cfg_attr(feature = "serde", serde(borrow))]
22 pub trie_data: ZeroVec<'data, u16>,
23 }
24
25 icu_provider::data_struct!(
26 UCharDictionaryBreakData<'_>,
27 #[cfg(feature = "datagen")]
28 );
29
30 pub(crate) struct UCharDictionaryBreakDataV1;
31
32 impl DynamicDataMarker for UCharDictionaryBreakDataV1 {
33 type DataStruct = UCharDictionaryBreakData<'static>;
34 }