@@ -66,13 +66,13 @@ pub const METADATA_HEADER: &[u8] = &[b'r', b'u', b's', b't', 0, 0, 0, METADATA_V
66
66
///
67
67
/// Metadata is effective a tree, encoded in post-order,
68
68
/// and with the root's position written next to the header.
69
- /// That means every single `Lazy ` points to some previous
69
+ /// That means every single `LazyValue ` points to some previous
70
70
/// location in the metadata and is part of a larger node.
71
71
///
72
- /// The first `Lazy ` in a node is encoded as the backwards
72
+ /// The first `LazyValue ` in a node is encoded as the backwards
73
73
/// distance from the position where the containing node
74
- /// starts and where the `Lazy ` points to, while the rest
75
- /// use the forward distance from the previous `Lazy `.
74
+ /// starts and where the `LazyValue ` points to, while the rest
75
+ /// use the forward distance from the previous `LazyValue `.
76
76
/// Distances start at 1, as 0-byte nodes are invalid.
77
77
/// Also invalid are nodes being referred in a different
78
78
/// order than they were encoded in.
@@ -94,12 +94,12 @@ impl<T> LazyValue<T> {
94
94
95
95
/// A list of lazily-decoded values.
96
96
///
97
- /// Unlike `Lazy <Vec<T>>`, the length is encoded next to the
97
+ /// Unlike `LazyValue <Vec<T>>`, the length is encoded next to the
98
98
/// position, not at the position, which means that the length
99
99
/// doesn't need to be known before encoding all the elements.
100
100
///
101
101
/// If the length is 0, no position is encoded, but otherwise,
102
- /// the encoding is that of `Lazy `, with the distinction that
102
+ /// the encoding is that of `LazyArray `, with the distinction that
103
103
/// the minimal distance the length of the sequence, i.e.
104
104
/// it's assumed there's no 0-byte element in the sequence.
105
105
struct LazyArray < T > {
@@ -167,17 +167,17 @@ impl<I, T> Clone for LazyTable<I, T> {
167
167
}
168
168
}
169
169
170
- /// Encoding / decoding state for `Lazy`.
170
+ /// Encoding / decoding state for `Lazy`s (`LazyValue`, `LazyArray`, and `LazyTable`) .
171
171
#[ derive( Copy , Clone , PartialEq , Eq , Debug ) ]
172
172
enum LazyState {
173
173
/// Outside of a metadata node.
174
174
NoNode ,
175
175
176
- /// Inside a metadata node, and before any `Lazy`.
176
+ /// Inside a metadata node, and before any `Lazy`s .
177
177
/// The position is that of the node itself.
178
178
NodeStart ( NonZeroUsize ) ,
179
179
180
- /// Inside a metadata node, with a previous `Lazy`.
180
+ /// Inside a metadata node, with a previous `Lazy`s .
181
181
/// The position is where that previous `Lazy` would start.
182
182
Previous ( NonZeroUsize ) ,
183
183
}
0 commit comments