pub struct FileDiff {
pub old_path: Option<String>,
pub new_path: Option<String>,
pub status: DeltaStatus,
pub hunks: Vec<Hunk>,
}Expand description
The diff for a single file between a commit and its parent commit.
Represents all changes made to one file in a single commit. A file may have been added (old_path is None), deleted (new_path is None), renamed (both paths differ), or modified (both paths are the same).
Fields§
§old_path: Option<String>Path in the old (parent) version, or None if the file was newly added.
new_path: Option<String>Path in the new (commit) version, or None if the file was deleted.
status: DeltaStatusThe git delta status indicating the type of change.
hunks: Vec<Hunk>The list of changed regions in this file. A simple one-line change produces one hunk; scattered edits produce multiple hunks.
Trait Implementations§
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
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