Skip to main content

parse_frontmatter

Function parse_frontmatter 

Source
pub fn parse_frontmatter(md: &str) -> Result<ManifestFrontmatter, Error>
Expand description

Parse the ---...--- YAML frontmatter at the top of a MANIFEST.md document into a strongly-typed struct.

Returns Error::MissingFrontmatter if the document does not begin with a --- line or the closing fence is absent, and Error::MissingField { field } if the YAML parses but is missing one of the six required keys (volume, distro, distro-version, created, kernel-source, distro-source).