Read an attestation from a reader (e.g., a file).
(reader: &mut R)
| 476 | |
| 477 | /// Read an attestation from a reader (e.g., a file). |
| 478 | pub fn read_from<R: Read>(reader: &mut R) -> Result<(Self, Hash), AttestationError> { |
| 479 | let mut data = Vec::new(); |
| 480 | reader |
| 481 | .read_to_end(&mut data) |
| 482 | .map_err(AttestationError::Io)?; |
| 483 | Self::deserialize(&data) |
| 484 | } |
| 485 | |
| 486 | /// Write an attestation to a writer (e.g., a file). |
| 487 | pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, AttestationError> { |
nothing calls this directly
no test coverage detected