pub enum ChangelogAction {
ReplaceEntryChanges {
file: PathBuf,
version: String,
lines: Vec<String>,
},
SetEntryDate {
file: PathBuf,
version: String,
rfc2822: String,
},
RemoveBullet {
file: PathBuf,
version: String,
author: Option<String>,
text: String,
occurrence: usize,
},
ReplaceBullet {
file: PathBuf,
version: String,
author: Option<String>,
text: String,
occurrence: usize,
new_lines: Vec<String>,
},
SetEntryVersion {
file: PathBuf,
version: String,
new_version: String,
},
}Expand description
Edits to a debian/changelog.
Operations target entries by their version, which is stable across minor edits. Change-line content is supplied verbatim — the applier preserves the changelog’s existing indentation rules when re-rendering.
Variants§
ReplaceEntryChanges
Replace the change lines of the entry with the given version. The
lines are stored verbatim with their leading */
continuation prefix; the applier writes them as-is into the entry.
Fields
SetEntryDate
Set the trailer datetime of the entry with the given version.
The datetime is stored as an RFC 2822 string ("Sun, 22 Apr 2018 00:58:14 +0000") — what chrono::DateTime::to_rfc2822 produces
and what changelog trailers use natively.
Fields
RemoveBullet
Remove a bullet from the entry with the given version.
The bullet is identified by its author attribution (the [ Name ]
header that introduces multi-author groups, or None for an entry
without one) and its body text (the bullet’s lines joined with
\n, exactly as debian_changelog’s Bullet::lines() returns
them).
occurrence is a 0-based index that disambiguates when several
bullets share the same (author, text) key: 0 removes the first
match, 1 the second, etc. The applier walks bullets in
iter_changes_by_author order. Whitespace between surviving
bullets is preserved.
Fields
Author header above the bullet, if any.
ReplaceBullet
Replace the body lines of a bullet, identified the same way as in
RemoveBullet. new_lines are stored
without their */ continuation prefix — the applier
passes them straight to Bullet::replace_with, which re-adds the
proper indentation.
Fields
Author header above the bullet, if any.
SetEntryVersion
Replace the version of the entry currently identified by version
with new_version. A no-op if no entry has that version.
Trait Implementations§
Source§impl Clone for ChangelogAction
impl Clone for ChangelogAction
Source§fn clone(&self) -> ChangelogAction
fn clone(&self) -> ChangelogAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChangelogAction
impl Debug for ChangelogAction
Source§impl<'de> Deserialize<'de> for ChangelogAction
impl<'de> Deserialize<'de> for ChangelogAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ChangelogAction
Source§impl PartialEq for ChangelogAction
impl PartialEq for ChangelogAction
Source§fn eq(&self, other: &ChangelogAction) -> bool
fn eq(&self, other: &ChangelogAction) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ChangelogAction
impl Serialize for ChangelogAction
impl StructuralPartialEq for ChangelogAction
Auto Trait Implementations§
impl Freeze for ChangelogAction
impl RefUnwindSafe for ChangelogAction
impl Send for ChangelogAction
impl Sync for ChangelogAction
impl Unpin for ChangelogAction
impl UnsafeUnpin for ChangelogAction
impl UnwindSafe for ChangelogAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.