alpm_pkginfo::commands

Function parse

Source
pub fn parse(file: Option<PathBuf>) -> Result<Box<dyn Serialize>, Error>
Expand description

Parses a file according to a PKGINFO schema.

Returns a serializable PackageInfo if the file is valid, otherwise an error is returned.

NOTE: If a command is piped to this process, the input is read from stdin. See IsTerminal for more information about how terminal detection works.

ยงErrors

Returns an error if the file can not be read, if the file can not be parsed, or if the file is not valid according to the schema.