pub struct FileDiff {Show 15 fields
pub path: String,
pub old_path: Option<String>,
pub status: DiffStatus,
pub old_mode: Option<String>,
pub new_mode: Option<String>,
pub old_oid: ObjectId,
pub new_oid: ObjectId,
pub binary: bool,
pub old_size: u64,
pub new_size: u64,
pub content_changed: bool,
pub old_encoding_lossy: bool,
pub new_encoding_lossy: bool,
pub hunks: Vec<StructuredHunk>,
pub line_stat: Option<LineStat>,
}Expand description
One changed file with structured hunks and metadata (returned by Diff::files).
Always carries Self::hunks when line diff was computed. For stat-or-patch listing rows
from build_file_diffs, use ListedFileDiff
instead (structured hunks and line counts are optional there).
Fields§
§path: StringDisplay path (new path, or old path for a deletion).
old_path: Option<String>Pre-rename path when it differs from Self::path.
status: DiffStatusChange kind for this path.
old_mode: Option<String>Old git mode (octal), when present on this side.
new_mode: Option<String>New git mode (octal), when present on this side.
old_oid: ObjectIdOld blob OID on this side (zero when absent).
new_oid: ObjectIdNew blob OID on this side (zero when absent).
binary: boolTrue when either side was treated as binary (NUL in the first 8 KiB).
old_size: u64Old-side byte length (for binary --stat and JSON).
new_size: u64New-side byte length (for binary --stat and JSON).
content_changed: boolTrue when blob content changed (not a mode-only touch on the same OID).
old_encoding_lossy: boolOld side was decoded with lossy UTF-8.
new_encoding_lossy: boolNew side was decoded with lossy UTF-8.
hunks: Vec<StructuredHunk>Structured line hunks for text files.
line_stat: Option<LineStat>Precomputed line counts when stat was requested without building hunks.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.