(&mut self, buf: &mut [u8], mut gen_block: impl FnMut(&mut Array<u8, BS>))
| 135 | /// from the last generated block into the buffer for future use. |
| 136 | #[inline] |
| 137 | pub fn read(&mut self, buf: &mut [u8], mut gen_block: impl FnMut(&mut Array<u8, BS>)) { |
| 138 | let head_ks = self.read_cached(buf.len()); |
| 139 | let (head, buf) = buf.split_at_mut(head_ks.len()); |
| 140 | let (blocks, tail) = Array::slice_as_chunks_mut(buf); |
| 141 | |
| 142 | head.copy_from_slice(head_ks); |
| 143 | for block in blocks { |
| 144 | gen_block(block); |
| 145 | } |
| 146 | |
| 147 | self.write_block(tail.len(), gen_block, |tail_ks| { |
| 148 | tail.copy_from_slice(tail_ks); |
| 149 | }); |
| 150 | } |
| 151 | |
| 152 | /// Serialize buffer into a byte array. |
| 153 | #[inline] |
nothing calls this directly
no test coverage detected