pub struct GitDiffDocument {
pub repo_root: PathBuf,
pub files: Vec<FileDiff>,
}Expand description
A parsed git diff for the current repository.
Produced by running git diff against the working tree and parsing the unified diff output. Contains the repository root path and a list of FileDiff entries, one per changed file.
§Structure
GitDiffDocument
└─ Vec<FileDiff>
├─ path, old_path, status, binary
└─ Vec<Hunk>
├─ header, line ranges
└─ Vec<PatchLine>
└─ kind (Context | Added | Removed | HunkHeader | Meta) + text§See also
FileDiff— a single file’s changesFileStatus— Modified, Added, Deleted, or RenamedGitDiffError— errors from git operations
Fields§
§repo_root: PathBuf§files: Vec<FileDiff>Auto Trait Implementations§
impl Freeze for GitDiffDocument
impl RefUnwindSafe for GitDiffDocument
impl Send for GitDiffDocument
impl Sync for GitDiffDocument
impl Unpin for GitDiffDocument
impl UnsafeUnpin for GitDiffDocument
impl UnwindSafe for GitDiffDocument
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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