Slices this [`RunEndBuffer`] by the provided `logical_offset` and `logical_length`. # Panics - Specified slice (`logical_offset` + `logical_length`) exceeds existing logical length
(&self, logical_offset: usize, logical_length: usize)
| 273 | /// - Specified slice (`logical_offset` + `logical_length`) exceeds existing |
| 274 | /// logical length |
| 275 | pub fn slice(&self, logical_offset: usize, logical_length: usize) -> Self { |
| 276 | assert!( |
| 277 | logical_offset.saturating_add(logical_length) <= self.logical_length, |
| 278 | "the length + offset of the sliced RunEndBuffer cannot exceed the existing length" |
| 279 | ); |
| 280 | Self { |
| 281 | run_ends: self.run_ends.clone(), |
| 282 | logical_offset: self.logical_offset + logical_offset, |
| 283 | logical_length, |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | /// Returns the inner [`ScalarBuffer`]. |
| 288 | pub fn inner(&self) -> &ScalarBuffer<E> { |