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 ).
45/// Intermediate metadata for a branch node under construction.
6#[derive(#[automatically_derived]
impl ::core::fmt::Debug for BranchMeta {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f, "BranchMeta",
"ascii", &self.ascii, "local_length", &self.local_length,
"cumulative_length", &self.cumulative_length, "count",
&&self.count)
}
}Debug, #[automatically_derived]
impl ::core::clone::Clone for BranchMeta {
#[inline]
fn clone(&self) -> BranchMeta {
let _: ::core::clone::AssertParamIsClone<u8>;
let _: ::core::clone::AssertParamIsClone<usize>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::Copy for BranchMeta { }Copy)]
7pub(crate) struct BranchMeta {
8/// The lead byte for this branch. Formerly it was required to be an ASCII byte, but now
9 /// it can be any byte.
10pub ascii: u8,
11/// The size in bytes of the trie data reachable from this branch.
12pub local_length: usize,
13/// The size in bytes of this and all later sibling branches.
14pub cumulative_length: usize,
15/// The number of later sibling branches, including this.
16pub count: usize,
17}
1819impl BranchMeta {
20/// Creates a new empty [`BranchMeta`].
21pub const fn default() -> Self {
22BranchMeta {
23 ascii: 0,
24 cumulative_length: 0,
25 local_length: 0,
26 count: 0,
27 }
28 }
29}