Struct parse_changelog::Parser[][src]

pub struct Parser { /* fields omitted */ }
Expand description

A changelog parser.

Implementations

Creates a new changelog parser.

Sets the version format.

## v0.1.0 -- 2020-01-01
    ^^^^^

The default version format is based on Semantic Versioning and is the following regular expression:

^\d+\.\d+\.\d+(-[\w\.-]+)?(\+[\w\.-]+)?

Note: Most projects that adopt Semantic Versioning do not need to change this.

To customize the text before the version number (e.g., “v” in “# v0.1.0”, “Version “ in “# Version 0.1.0”, etc.), use the prefix_format method instead of this method.

Errors

Returns an error if any of the following:

  • The specified format is not a valid regular expression or supported by regex crate.
  • The specified format is empty or contains only whitespace.

Sets the prefix format.

“Prefix” means the range from the first non-whitespace character after heading to the character before the version (including whitespace characters). For example:

## Version 0.1.0 -- 2020-01-01
   ^^^^^^^^
## v0.1.0 -- 2020-01-01
   ^

The default prefix format is the following regular expression:

^(v|Version |Release )?

Errors

Returns an error if any of the following:

  • The specified format is not a valid regular expression or supported by regex crate.
  • The specified format is empty or contains only whitespace.

Parses release notes from the given text.

See crate level documentation for changelog and version format supported by default.

Errors

Returns an error if any of the following:

  • There are multiple release notes for one version.
  • No release was found. This usually means that the changelog isn’t written in the supported format, or that the specified format is wrong if you specify your own format.

An iterator over all release notes in the given text.

Unlike parse method, this method doesn’t error on duplicate release notes or empty changelog.

See crate level documentation for changelog and version format supported by default.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.