(&mut self, offset: u32, src: &[u8])
| 205 | /// Returns an error on out-of-bounds accesses. |
| 206 | #[inline] |
| 207 | pub fn copy_from_slice(&mut self, offset: u32, src: &[u8]) -> Result<()> { |
| 208 | let offset = usize::try_from(offset)?; |
| 209 | let into = match self |
| 210 | .data |
| 211 | .get_mut(offset..) |
| 212 | .and_then(|s| s.get_mut(..src.len())) |
| 213 | { |
| 214 | Some(into) => into, |
| 215 | None => bail_bug!("out of bounds copy"), |
| 216 | }; |
| 217 | into.copy_from_slice(src); |
| 218 | Ok(()) |
| 219 | } |
| 220 | |
| 221 | /// Copy within this this object's data. |
| 222 | /// |
no test coverage detected