pub enum Event<'a, 'old, 'new> {
Addition {
entry_mode: EntryMode,
id: Id<'new>,
},
Deletion {
entry_mode: EntryMode,
id: Id<'old>,
},
Modification {
previous_entry_mode: EntryMode,
previous_id: Id<'old>,
entry_mode: EntryMode,
id: Id<'new>,
},
Rewrite {
source_location: &'a BStr,
source_entry_mode: EntryMode,
source_id: Id<'old>,
diff: Option<DiffLineStats>,
entry_mode: EntryMode,
id: Id<'new>,
copy: bool,
},
}
blob-diff
only.Expand description
An event emitted when finding differences between two trees.
Variants§
Addition
An entry was added, like the addition of a file or directory.
Fields
Deletion
An entry was deleted, like the deletion of a file or directory.
Fields
Modification
An entry was modified, e.g. changing the contents of a file adjusts its object id and turning a file into a symbolic link adjusts its mode.
Fields
Rewrite
Entries are considered rewritten if they are not trees and they, according to some understanding of identity, were renamed
or copied.
In case of renames, this means they originally appeared as Deletion
signalling their source as well as an
Addition
acting as destination.
In case of copies, the copy
flag is true and typically represents a perfect copy of a source was made.
This variant can only be encountered if rewrite tracking is enabled.
Note that mode changes may have occurred as well, i.e. changes from executable to non-executable or vice-versa.
Fields
source_location: &'a BStr
The location of the source of the rename operation.
It may be empty if neither file names nor file paths are tracked.
source_id: Id<'old>
The object id of the entry before the rename.
Note that this is the same as id
if we require the similarity to be 100%, but may
be different otherwise.
diff: Option<DiffLineStats>
Information about the diff we performed to detect similarity and match the source_id
with the current state at id
.
It’s None
if source_id
is equal to id
, as identity made an actual diff computation unnecessary.
Implementations§
Trait Implementations§
impl<'a, 'old, 'new> Copy for Event<'a, 'old, 'new>
Auto Trait Implementations§
impl<'a, 'old, 'new> Freeze for Event<'a, 'old, 'new>
impl<'a, 'old, 'new> !RefUnwindSafe for Event<'a, 'old, 'new>
impl<'a, 'old, 'new> !Send for Event<'a, 'old, 'new>
impl<'a, 'old, 'new> !Sync for Event<'a, 'old, 'new>
impl<'a, 'old, 'new> Unpin for Event<'a, 'old, 'new>
impl<'a, 'old, 'new> !UnwindSafe for Event<'a, 'old, 'new>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)