The bytes of `start..end` in `hash`'s content, if one held span covers them.
(&self, hash: &Hash, start: usize, end: usize, buf: &mut [u8])
| 143 | impl SpanOverlay { |
| 144 | /// The bytes of `start..end` in `hash`'s content, if one held span covers them. |
| 145 | fn copy(&self, hash: &Hash, start: usize, end: usize, buf: &mut [u8]) -> Option<usize> { |
| 146 | let (&(h, s), (e, bytes)) = self.spans.range(..=(*hash, start as u64)).next_back()?; |
| 147 | if h != *hash || (end as u64) > *e { |
| 148 | return None; |
| 149 | } |
| 150 | let from = start - s as usize; |
| 151 | let len = end - start; |
| 152 | buf.get_mut(..len)? |
| 153 | .copy_from_slice(bytes.get(from..from + len)?); |
| 154 | Some(len) |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | impl std::fmt::Debug for ChangeStore { |