Builds interest with specific range.
(mut self, range: impl Into<RangeOpen<&'a [u8]>>)
| 251 | } |
| 252 | /// Builds interest with specific range. |
| 253 | pub fn with_range<'a>(mut self, range: impl Into<RangeOpen<&'a [u8]>>) -> Builder<WithRange> { |
| 254 | let range = range.into(); |
| 255 | self.state |
| 256 | .encoder |
| 257 | .u8(1) |
| 258 | .expect("range start indicator should cbor encode") |
| 259 | .bytes(range.start) |
| 260 | .expect("start_key should cbor encode") |
| 261 | .bytes(range.end) |
| 262 | .expect("end_key should cbor encode"); |
| 263 | Builder { |
| 264 | state: WithRange { |
| 265 | encoder: self.state.encoder, |
| 266 | }, |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | impl Builder<WithRange> { |
| 271 | /// Builds interest as fencepost. |