Read an attestation from a reader (e.g., a file).
(reader: &mut R)
| 239 | |
| 240 | /// Read an attestation from a reader (e.g., a file). |
| 241 | pub fn read_from<R: Read>(reader: &mut R) -> Result<(Self, Hash), AttestationError> { |
| 242 | let mut data = Vec::new(); |
| 243 | reader |
| 244 | .read_to_end(&mut data) |
| 245 | .map_err(AttestationError::Io)?; |
| 246 | Self::deserialize(&data) |
| 247 | } |
| 248 | |
| 249 | /// Write an attestation to a writer (e.g., a file). |
| 250 | pub fn write_to<W: Write>(&self, writer: &mut W) -> Result<Hash, AttestationError> { |
nothing calls this directly
no test coverage detected