pub struct TextDiff {
pub ops: Vec<DiffOp>,
pub similarity: f64,
}Expand description
The result of comparing two text outputs.
Fields§
§ops: Vec<DiffOp>Sequence of edit operations transforming old into new.
similarity: f64Jaccard similarity on word bags: 0.0 = no overlap, 1.0 = identical.
Implementations§
Source§impl TextDiff
impl TextDiff
Sourcepub fn insertions(&self) -> usize
pub fn insertions(&self) -> usize
Returns the number of inserted lines.
Sourcepub fn is_identical(&self) -> bool
pub fn is_identical(&self) -> bool
Returns true if the two texts were identical.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TextDiff
impl<'de> Deserialize<'de> for TextDiff
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 TextDiff
impl RefUnwindSafe for TextDiff
impl Send for TextDiff
impl Sync for TextDiff
impl Unpin for TextDiff
impl UnsafeUnpin for TextDiff
impl UnwindSafe for TextDiff
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