pub struct FileDiff {
pub a_path: Option<String>,
pub b_path: Option<String>,
pub status: FileDiffStatus,
pub hunks: Vec<DiffHunk>,
pub additions: u32,
pub deletions: u32,
}Expand description
A diff for a single path. The shape carries enough information to render git-style unified output, group changes per-hunk in a UI, and surface summary stats.
Fields§
§a_path: Option<String>Path on the a side. May differ from b_path for renames; v1
always sets these equal.
b_path: Option<String>Path on the b side.
status: FileDiffStatusFile-level status.
hunks: Vec<DiffHunk>Hunks; empty when status is Unchanged/Binary.
additions: u32Total + lines across all hunks.
deletions: u32Total - lines across all hunks.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileDiff
impl<'de> Deserialize<'de> for FileDiff
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 FileDiff
impl StructuralPartialEq for FileDiff
Auto Trait Implementations§
impl Freeze for FileDiff
impl RefUnwindSafe for FileDiff
impl Send for FileDiff
impl Sync for FileDiff
impl Unpin for FileDiff
impl UnsafeUnpin for FileDiff
impl UnwindSafe for FileDiff
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