Append content to the contents blob. Returns the starting position of the appended content.
(&mut self, data: &[u8])
| 274 | /// |
| 275 | /// Returns the starting position of the appended content. |
| 276 | pub fn append_contents(&mut self, data: &[u8]) -> usize { |
| 277 | let start = self.contents.len(); |
| 278 | self.contents.extend_from_slice(data); |
| 279 | start |
| 280 | } |
| 281 | |
| 282 | /// Recompute the contents hash after modifying contents. |
| 283 | pub fn finalize(&mut self) { |