#[non_exhaustive]pub struct FileDiff {
pub change: ChangeKind,
pub path: String,
pub old_path: Option<String>,
pub hunks: Vec<Hunk>,
}Expand description
One file’s entry in a parsed git-format unified diff (git diff or
jj diff --git).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.change: ChangeKindHow the file changed.
path: StringThe file’s path — the new path for a rename — forward-slash normalised.
old_path: Option<String>For a rename, the original path (forward-slash normalised); None otherwise.
hunks: Vec<Hunk>The @@ hunks; empty for a binary file or a pure rename with no edits.
Trait Implementations§
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