pub struct Change {
pub id: usize,
pub spans: Vec<ChangeSpan>,
pub description: Option<String>,
}Expand description
A complete change unit (may contain multiple spans for word-level diffs)
Fields§
§id: usizeUnique ID for this change
spans: Vec<ChangeSpan>The spans that make up this change
description: Option<String>Description of the change (e.g., “modified function call”)
Implementations§
Source§impl Change
impl Change
pub fn new(id: usize, spans: Vec<ChangeSpan>) -> Self
pub fn single(id: usize, span: ChangeSpan) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Sourcepub fn changes(&self) -> impl Iterator<Item = &ChangeSpan>
pub fn changes(&self) -> impl Iterator<Item = &ChangeSpan>
Get all the changes (non-equal spans)
Sourcepub fn has_changes(&self) -> bool
pub fn has_changes(&self) -> bool
Check if this change contains any actual modifications
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Change
impl StructuralPartialEq for Change
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
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