Module parser

Source

Structs§

ParseError
An error encountered while parsing a CODEOWNERS file. Contains a message describing the error and a Span indicating the location of the error.
ParseResult
The result of parsing a CODEOWNERS file. Contains a Vec of parsed rules and a Vec of errors encountered during parsing. If the Vec of errors is non-empty, the Vec of rules may be incomplete. If the Vec of errors is empty, the file was parsed successfully.
Rule
A parsed CODEOWNERS rule. Contains a pattern and a list of owners, along with any comments that were found before or after the rule. All fields are wrapped in Spanned to preserve the original source location.
Span
A span of text in a CODEOWNERS file. Contains the start and end byte offsets of the span.
Spanned
A wrapper around a value that preserves the original source location of the value. Contains the value and a Span indicating the location of the value.

Functions§

parse
Parse a CODEOWNERS file from a string, returning a ParseResult containing the parsed rules and any errors encountered.
parse_file
Parse a CODEOWNERS file from a file path, reading the contents of the file and returning a ParseResult containing the parsed rules and any errors encountered.