pub struct DiffEntry {
pub path: String,
pub diff_type: DiffType,
pub is_dir: bool,
pub before_text: Option<String>,
pub after_text: Option<String>,
pub is_binary: bool,
pub before_size: Option<u64>,
pub after_size: Option<u64>,
pub before_sha256: Option<String>,
pub after_sha256: Option<String>,
pub stats: Option<DiffStats>,
pub error_detail: Option<String>,
}Expand description
One entry in the diff result.
Fields§
§path: StringRoot-relative path with forward slashes.
diff_type: DiffType§is_dir: bool§before_text: Option<String>§after_text: Option<String>§is_binary: boolTrue when the file cannot be decoded as UTF-8.
before_size: Option<u64>File size in bytes of the before-file, if available.
after_size: Option<u64>File size in bytes of the after-file, if available.
before_sha256: Option<String>SHA-256 hex digest of the before-file.
after_sha256: Option<String>SHA-256 hex digest of the after-file.
stats: Option<DiffStats>Set for Modified text files; None for binary / non-Modified entries.
error_detail: Option<String>Implementations§
Source§impl DiffEntry
impl DiffEntry
pub fn has_text_diff(&self) -> bool
Sourcepub fn size_change_label(&self) -> Option<String>
pub fn size_change_label(&self) -> Option<String>
Human-readable size change description, e.g. “12 KB → 15 KB”.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DiffEntry
impl RefUnwindSafe for DiffEntry
impl Send for DiffEntry
impl Sync for DiffEntry
impl Unpin for DiffEntry
impl UnsafeUnpin for DiffEntry
impl UnwindSafe for DiffEntry
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