@@ -30,59 +30,59 @@ pub struct PackedSkeletonDataBuilder<'a> {
30
30
size_test ! ( PackedSkeletonDataV2 , packed_skeleton_data_size, 32 ) ;
31
31
32
32
/// Main data struct for packed datetime patterns.
33
- ///
33
+ ///
34
34
/// ## Variants
35
- ///
35
+ ///
36
36
/// This supports a set of "standard" patterns plus up to two "variants".
37
37
/// The variants are currently used by year formatting:
38
- ///
38
+ ///
39
39
/// - Standard: Year, which could be partial precision (2-digit Gregorain)
40
40
/// - Variant 0: Full Year, which is always full precision
41
41
/// - Variant 1: Year With Era
42
- ///
42
+ ///
43
43
/// Variants should be used when the pattern could depend on the value being
44
44
/// formatted. For example, with [`EraDisplay::Auto`], any of these three
45
45
/// patterns could be selected based on the year value.
46
- ///
46
+ ///
47
47
/// ## Representation
48
- ///
48
+ ///
49
49
/// Currently, there are at most 9 patterns that need to be stored together,
50
50
/// named according to this table:
51
- ///
51
+ ///
52
52
/// | | Standard | Variant 0 | Variant 1 |
53
53
/// |--------|----------|-----------|-----------|
54
54
/// | Long | La | Lb | Lc |
55
55
/// | Medium | Ma | Mb | Mc |
56
56
/// | Short | Sa | Sb | Sc |
57
- ///
57
+ ///
58
58
/// The header byte encodes which pattern in the patterns array corresponds to
59
59
/// a particular cell in the table. It contains the following information:
60
- ///
60
+ ///
61
61
/// - Bits 0-1: "LMS" value of the standard column
62
62
/// - Bit 2: "Q" value: 1 for directly-indexed variants; 0 for per-cell offsets
63
63
/// - Bits 3-20: Packed offset into patterns table for each variant cell
64
64
/// - Bits 21-31: unused/reserved
65
- ///
65
+ ///
66
66
/// The LMS value determines which pattern index is used for the first column:
67
- ///
67
+ ///
68
68
/// | LMS Value | Long Index | Medium Index | Short Index |
69
69
/// |-----------|------------|--------------|-------------|
70
70
/// | 0 | 0 | 0 | 0 |
71
71
/// | 1 | 0 | 1 | 1 |
72
72
/// | 2 | 0 | 0 | 1 |
73
73
/// | 3 | 0 | 1 | 2 |
74
- ///
74
+ ///
75
75
/// If bit 2 is 1 (Q=1), it means there is one pattern per variant index,
76
76
/// with the index offset by the short index `S` from the table above.
77
77
/// However, this requires storing multiple, possibly duplicate, patterns in
78
78
/// the packed structure. The more common case is Q=0 and then to store
79
79
/// per-cell offsets in chunks of 3 bits per cell:
80
- ///
80
+ ///
81
81
/// - Chunk = 0: Inherit according to the table below
82
82
/// - Chunk = 1-7: Use pattern index Chunk - 1
83
- ///
83
+ ///
84
84
/// This is summarized below:
85
- ///
85
+ ///
86
86
/// | Cell in Table | Q=1 Pattern Index | Q=0 Header Bits | Inheritance |
87
87
/// |---------------|-------------------|-----------------|-------------|
88
88
/// | Lb | S + 1 | 3-5 | La |
0 commit comments