pub struct DiffEntry {
pub status: DiffStatus,
pub old_path: Option<String>,
pub new_path: Option<String>,
pub old_mode: String,
pub new_mode: String,
pub old_oid: ObjectId,
pub new_oid: ObjectId,
pub score: Option<u32>,
}Expand description
A single diff entry representing one changed path.
Fields§
§status: DiffStatusThe status of this change.
old_path: Option<String>Path in the “old” side (None for Added).
new_path: Option<String>Path in the “new” side (None for Deleted).
old_mode: StringOld file mode (as octal string, e.g. “100644”).
new_mode: StringNew file mode.
old_oid: ObjectIdOld object ID (zero OID for Added).
new_oid: ObjectIdNew object ID (zero OID for Deleted).
score: Option<u32>Similarity score (0–100) for renames/copies.
Implementations§
Source§impl DiffEntry
impl DiffEntry
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
The primary path for display (new_path for adds, old_path for deletes).
Sourcepub fn display_path(&self) -> String
pub fn display_path(&self) -> String
Return a human-oriented path display for this entry.
For renames and copies this returns old -> new; for all other entry
kinds this returns the primary path.
Trait Implementations§
impl Eq for DiffEntry
impl StructuralPartialEq for DiffEntry
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