(&mut self, addr: usize, src: &[u8])
| 172 | |
| 173 | #[inline(always)] |
| 174 | fn write(&mut self, addr: usize, src: &[u8]) -> usize { |
| 175 | if addr >= self.len || src.is_empty() { |
| 176 | return 0; |
| 177 | } |
| 178 | |
| 179 | let chunk_idx = addr >> self.chunk_shift; |
| 180 | let chunk_offset = addr & self.chunk_mask; |
| 181 | let write_len = min(min(self.chunk_size - chunk_offset, self.len - addr), src.len()); |
| 182 | |
| 183 | let Ok(chunk) = self.chunk_mut(chunk_idx) else { |
| 184 | return 0; |
| 185 | }; |
| 186 | chunk[chunk_offset..chunk_offset + write_len].copy_from_slice(&src[..write_len]); |
| 187 | write_len |
| 188 | } |
| 189 | |
| 190 | #[inline(always)] |
| 191 | fn write_all(&mut self, addr: usize, src: &[u8]) -> Option<()> { |
nothing calls this directly
no test coverage detected