pub struct AstDiff {
pub nodes_added: u32,
pub nodes_removed: u32,
pub nodes_modified: u32,
pub edit_distance: u32,
pub primary_change: Option<String>,
}Expand description
AST diff summary
Fields§
§nodes_added: u32Number of nodes added
nodes_removed: u32Number of nodes removed
nodes_modified: u32Number of nodes modified
edit_distance: u32Structural edit distance
primary_change: Option<String>Most common diff type
Implementations§
Source§impl AstDiff
impl AstDiff
Sourcepub fn total_changes(&self) -> u32
pub fn total_changes(&self) -> u32
Total number of changes
Sourcepub fn similarity(&self, total_nodes: u32) -> f32
pub fn similarity(&self, total_nodes: u32) -> f32
Similarity score (1.0 = identical, 0.0 = completely different)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AstDiff
impl<'de> Deserialize<'de> for AstDiff
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
Auto Trait Implementations§
impl Freeze for AstDiff
impl RefUnwindSafe for AstDiff
impl Send for AstDiff
impl Sync for AstDiff
impl Unpin for AstDiff
impl UnsafeUnpin for AstDiff
impl UnwindSafe for AstDiff
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more