(&self, index: usize)
| 137 | } |
| 138 | } |
| 139 | pub fn get(&self, index: usize) -> Option<&RowRef> { |
| 140 | if index >= self.run_ends.len() { |
| 141 | return None; |
| 142 | } |
| 143 | let lo = if index == 0 { |
| 144 | 0 |
| 145 | } else { |
| 146 | self.run_ends[index - 1] - self.run_start |
| 147 | }; |
| 148 | let hi = self.run_ends[index] - self.run_start; |
| 149 | // SAFETY: endpoints and data taken from a pushed encoded run. |
| 150 | Some(unsafe { RowRef::from_slice(&self.bytes[lo..hi]) }) |
| 151 | } |
| 152 | |
| 153 | pub fn iter(&self) -> impl Iterator<Item = &RowRef> { |
| 154 | [0].into_iter() |