Skip to main content

parse_os_release

Function parse_os_release 

Source
pub fn parse_os_release(contents: &str) -> Result<OsRelease, ParseError>
Expand description

Parse the contents of an /etc/os-release file.

ยงErrors

Returns ParseError if:

  • The input exceeds MAX_OS_RELEASE_BYTES.
  • Any non-comment, non-blank line fails to parse as KEY=VALUE.
  • A value has mismatched quotes.
  • A value contains a NUL byte or ASCII control character (except tab).
  • No valid key-value pair was found at all.