pub struct FileDiff {
pub path: String,
pub old_path: Option<String>,
pub status: FileStatus,
pub binary: bool,
pub old_text: Option<String>,
pub new_text: Option<String>,
pub hunks: Vec<Hunk>,
pub hashes: HashCache,
}Fields§
§path: String§old_path: Option<String>§status: FileStatus§binary: bool§old_text: Option<String>Full contents of each side, used for whole-file syntax highlighting.
None for binary files and for the missing side of adds/deletes.
new_text: Option<String>§hunks: Vec<Hunk>§hashes: HashCacheLazily memoized content hashes; texts never change after construction.
Implementations§
Source§impl FileDiff
impl FileDiff
Sourcepub fn content_hash(&self) -> String
pub fn content_hash(&self) -> String
Content identity of the new side, used for viewed-mark invalidation.
Sourcepub fn sides_hash(&self) -> String
pub fn sides_hash(&self) -> String
Content identity of both sides, for caches derived from old and new
text (e.g. syntax highlighting). Viewed marks key on content_hash
instead: they only care about the side the reviewer reads.
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