parse

Function parse 

Source
pub fn parse<T, F>(path: &Path, parse_fn: F) -> Result<(T, Vec<u8>)>
where F: Fn(&[u8]) -> Result<T>,
Expand description

Parse a signify file.

Reads file at path (or stdin if “-”), parses the OpenBSD-compatible format (comment line + base64 line), and decodes the object using parse_fn.

§Errors

Returns Error::Io if file cannot be read. Returns Error::InvalidCommentHeader if header is missing or malformed. Returns Error::InvalidSignatureUtf8 if base64 is invalid utf8. Returns Error::Base64Decode if decoding fails. Returns various errors from parse_fn.