pub enum ChangeDescription {
SetField {
field: String,
old_value: String,
new_value: String,
},
UnsetField {
field: String,
old_value: String,
},
AddTag {
tag: String,
},
RemoveTag {
tag: String,
},
SetBody {
old_len: usize,
new_len: usize,
},
AppendBody {
added_len: usize,
},
ClearBody {
old_len: usize,
},
}Expand description
Describes a single change made to a file.
Variants§
SetField
UnsetField
AddTag
RemoveTag
SetBody
Replace the entire body (everything after the closing --- of the
frontmatter). old_len / new_len are byte counts, surfaced so
the report can say “shrank body from 1.2k → 80 bytes” without
echoing arbitrary user prose.
AppendBody
Append text to the existing body (separated by a caller-chosen
separator, default "\n"). added_len is the byte count of the
appended text (excluding separator) for the same reason.
ClearBody
Clear the body entirely — semantic shorthand for “set to empty”.
Carries old_len so an audit log can record what was removed.
Trait Implementations§
Source§impl Debug for ChangeDescription
impl Debug for ChangeDescription
Auto Trait Implementations§
impl Freeze for ChangeDescription
impl RefUnwindSafe for ChangeDescription
impl Send for ChangeDescription
impl Sync for ChangeDescription
impl Unpin for ChangeDescription
impl UnsafeUnpin for ChangeDescription
impl UnwindSafe for ChangeDescription
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
Mutably borrows from an owned value. Read more