|
1 | 1 | //! Specifications for ranges selection in blobs and sequences of blobs.
|
2 | 2 | //!
|
3 |
| -//! The [`RangeSpec`] allows specifying which BAO chunks inside a single blob should be |
| 3 | +//! The [`ChunkRanges`] allows specifying which BAO chunks inside a single blob should be |
4 | 4 | //! selected.
|
5 | 5 | //!
|
6 |
| -//! The [`RangeSpecSeq`] builds on top of this to select blob chunks in an entire |
| 6 | +//! The [`ChunkRangesSeq`] builds on top of this to select blob chunks in an entire |
7 | 7 | //! collection.
|
8 | 8 | use std::{fmt, sync::OnceLock};
|
9 | 9 |
|
@@ -62,37 +62,37 @@ impl ChunkRangesSeq {
|
62 | 62 | Self(inner)
|
63 | 63 | }
|
64 | 64 |
|
65 |
| - /// A [`RangeSpecSeq`] containing all chunks from all blobs. |
| 65 | + /// A [`ChunkRangesSeq`] containing all chunks from all blobs. |
66 | 66 | ///
|
67 |
| - /// [`RangeSpecSeq::iter`], will return a full range forever. |
| 67 | + /// [`ChunkRangesSeq::iter`], will return a full range forever. |
68 | 68 | pub fn all() -> Self {
|
69 | 69 | let mut inner = SmallVec::new();
|
70 | 70 | inner.push((0, ChunkRanges::all()));
|
71 | 71 | Self(inner)
|
72 | 72 | }
|
73 | 73 |
|
74 |
| - /// A [`RangeSpecSeq`] getting the verified size for the first blob. |
| 74 | + /// A [`ChunkRangesSeq`] getting the verified size for the first blob. |
75 | 75 | pub fn verified_size() -> Self {
|
76 | 76 | let mut inner = SmallVec::new();
|
77 | 77 | inner.push((0, ChunkRanges::last_chunk()));
|
78 | 78 | inner.push((1, ChunkRanges::empty()));
|
79 | 79 | Self(inner)
|
80 | 80 | }
|
81 | 81 |
|
82 |
| - /// A [`RangeSpecSeq`] getting the entire first blob and verified sizes for all others. |
| 82 | + /// A [`ChunkRangesSeq`] getting the entire first blob and verified sizes for all others. |
83 | 83 | pub fn verified_child_sizes() -> Self {
|
84 | 84 | let mut inner = SmallVec::new();
|
85 | 85 | inner.push((0, ChunkRanges::all()));
|
86 | 86 | inner.push((1, ChunkRanges::last_chunk()));
|
87 | 87 | Self(inner)
|
88 | 88 | }
|
89 | 89 |
|
90 |
| - /// Checks if this [`RangeSpec`] does not select any chunks in the blob. |
| 90 | + /// Checks if this [`ChunkRangesSeq`] does not select any chunks in the blob. |
91 | 91 | pub fn is_empty(&self) -> bool {
|
92 | 92 | self.0.is_empty()
|
93 | 93 | }
|
94 | 94 |
|
95 |
| - /// Checks if this [`RangeSpec`] selects all chunks in the blob. |
| 95 | + /// Checks if this [`ChunkRangesSeq`] selects all chunks in the blob. |
96 | 96 | pub fn is_all(&self) -> bool {
|
97 | 97 | if self.0.len() != 1 {
|
98 | 98 | return false;
|
@@ -155,7 +155,7 @@ impl ChunkRangesSeq {
|
155 | 155 | /// This iterator will only yield items for blobs which have at least one chunk
|
156 | 156 | /// selected.
|
157 | 157 | ///
|
158 |
| - /// This iterator is infinite if the [`RangeSpecSeq`] ends on a non-empty [`RangeSpec`], |
| 158 | + /// This iterator is infinite if the [`ChunkRangesSeq`] ends on a non-empty [`ChunkRanges`], |
159 | 159 | /// that is all further blobs have selected chunks spans.
|
160 | 160 | pub fn iter_non_empty_infinite(&self) -> NonEmptyRequestRangeSpecIter<'_> {
|
161 | 161 | NonEmptyRequestRangeSpecIter::new(self.iter_infinite())
|
@@ -339,6 +339,9 @@ impl<'a> Iterator for NonEmptyRequestRangeSpecIter<'a> {
|
339 | 339 |
|
340 | 340 | /// A chunk range specification as a sequence of chunk offsets.
|
341 | 341 | ///
|
| 342 | +/// This is just the wire encoding of a [`ChunkRanges`]. You should rarely have to |
| 343 | +/// interact with this directly. |
| 344 | +/// |
342 | 345 | /// Offsets encode alternating spans starting on 0, where the first span is always
|
343 | 346 | /// deselected.
|
344 | 347 | ///
|
|
0 commit comments