Skip to content

Commit bcaac56

Browse files
committed
add docs comments to NoAllocBufferSegmentType variants
1 parent f099544 commit bcaac56

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

capnp/src/serialize/no_alloc_buffer_segments.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,14 @@ fn read_segment_table(slice: &[u8], options: ReaderOptions) -> Result<ReadSegmen
8585
pub type NoAllocSliceSegments<'b> = NoAllocBufferSegments<&'b [u8]>;
8686

8787
enum NoAllocBufferSegmentType {
88+
/// The buffer contains a single segment, with bounds given by the two
89+
/// `usize` parameters. The first parameter gives the byte offset of the
90+
/// start of the segment, and the second parameter gives the byte offset
91+
/// of its end.
8892
SingleSegment(usize, usize),
93+
94+
/// The buffer contains multiple segments. In this case, the segment table
95+
/// needs to be re-parsed on each call to `get_segment()`.
8996
MultipleSegments,
9097
}
9198

0 commit comments

Comments
 (0)