Compute the hash of this change without writing it. This serializes the change to a temporary buffer using the V3 format and returns the content hash from the trailer. # Errors Returns an error if serialization fails.
(&self)
| 282 | /// |
| 283 | /// Returns an error if serialization fails. |
| 284 | pub fn hash(&self) -> Result<Hash, ChangeError> { |
| 285 | let mut buffer = Vec::new(); |
| 286 | let hash = self.serialize(&mut buffer)?; |
| 287 | Ok(hash) |
| 288 | } |
| 289 | |
| 290 | /// Serialize this change to a writer using the V3 format. |
| 291 | /// |