pub struct ChangeLog(/* private fields */);Expand description
A node in the changelog syntax tree.
Implementations§
Source§impl ChangeLog
impl ChangeLog
Source§impl ChangeLog
impl ChangeLog
Sourcepub fn iter(&self) -> impl Iterator<Item = Entry> + '_
pub fn iter(&self) -> impl Iterator<Item = Entry> + '_
Returns an iterator over all entries in the changelog file.
Sourcepub fn entries(&self) -> impl Iterator<Item = Entry> + '_
👎Deprecated since 0.2.0: use iter instead
pub fn entries(&self) -> impl Iterator<Item = Entry> + '_
iter insteadReturns an iterator over all entries in the changelog file.
Sourcepub fn new_empty_entry(&mut self) -> EntryBuilder
pub fn new_empty_entry(&mut self) -> EntryBuilder
Create a new, empty entry.
Sourcepub fn try_auto_add_change(
&mut self,
change: &[&str],
author: (String, String),
datetime: Option<impl IntoTimestamp>,
urgency: Option<Urgency>,
) -> Result<Entry, Error>
pub fn try_auto_add_change( &mut self, change: &[&str], author: (String, String), datetime: Option<impl IntoTimestamp>, urgency: Option<Urgency>, ) -> Result<Entry, Error>
Add a change to the changelog.
This will update the current changelog entry if it is considered unreleased. Otherwise, a new entry will be created.
If there is an existing entry, the change will be added to the end of the entry. If the previous change was attributed to another author, a new section line (“[ Author Name ]”) will be added as well.
§Arguments
change- The change to add, e.g. &[“* Fix a bug”]author- The author of the change, e.g. (“John Doe”, “john@example”)
§Errors
Returns an error if text rewrapping fails.
Sourcepub fn auto_add_change(
&mut self,
change: &[&str],
author: (String, String),
datetime: Option<DateTime<FixedOffset>>,
urgency: Option<Urgency>,
) -> Entry
👎Deprecated since 0.2.10: Use try_auto_add_change for proper error handling
pub fn auto_add_change( &mut self, change: &[&str], author: (String, String), datetime: Option<DateTime<FixedOffset>>, urgency: Option<Urgency>, ) -> Entry
Automatically add a change to the changelog
If there is an existing entry, the change will be added to the end of the entry. If the previous change was attributed to another author, a new section line (“[ Author Name ]”) will be added as well.
§Deprecated
This function panics on errors. Use ChangeLog::try_auto_add_change instead for proper error handling.
§Panics
Panics if text rewrapping fails.
§Arguments
change- The change to add, e.g. &[“* Fix a bug”]author- The author of the change, e.g. (“John Doe”, “john@example”)
Sourcepub fn read_path(path: impl AsRef<Path>) -> Result<ChangeLog, Error>
pub fn read_path(path: impl AsRef<Path>) -> Result<ChangeLog, Error>
Read a changelog file from a path
Sourcepub fn read_relaxed<R: Read>(r: R) -> Result<ChangeLog, Error>
pub fn read_relaxed<R: Read>(r: R) -> Result<ChangeLog, Error>
Read a changelog file from a reader, allowing for syntax errors
Iterator over entries grouped by their maintainer (author).
Returns an iterator over tuples of (maintainer_name, maintainer_email, Vec
Get all unique authors across all entries in the changelog.
This includes both maintainers from entry footers and authors from [ Author Name ] sections.