pub enum ChangeRef<'a> {
Addition {
location: &'a BStr,
entry_mode: EntryMode,
relation: Option<Relation>,
id: ObjectId,
},
Deletion {
location: &'a BStr,
entry_mode: EntryMode,
relation: Option<Relation>,
id: ObjectId,
},
Modification {
location: &'a BStr,
previous_entry_mode: EntryMode,
previous_id: ObjectId,
entry_mode: EntryMode,
id: ObjectId,
},
Rewrite {
source_location: &'a BStr,
source_entry_mode: EntryMode,
source_relation: Option<Relation>,
source_id: ObjectId,
diff: Option<DiffLineStats>,
entry_mode: EntryMode,
id: ObjectId,
location: &'a BStr,
relation: Option<Relation>,
copy: bool,
},
}
blob
only.Expand description
Represents any possible change in order to turn one tree into another, which references data owned by its producer.
Variants§
Addition
An entry was added, like the addition of a file or directory.
Fields
location: &'a BStr
The location of the file or directory.
It may be empty if file names is None
.
Deletion
An entry was deleted, like the deletion of a file or directory.
Fields
location: &'a BStr
The location of the file or directory.
It may be empty if file names is None
.
are tracked.
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
location: &'a BStr
The location of the file or directory.
It may be empty if file names is None
.
are tracked.
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 or copy operation.
It may be empty if file names is None
.
are tracked.
source_relation: Option<Relation>
Identifies a relationship between the source and another source, making it easy to reconstruct the top-level of directory changes.
source_id: ObjectId
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.
entry_mode: EntryMode
The mode of the entry after the rename. It could differ but still be considered a rename as we are concerned only about content.
location: &'a BStr
The location after the rename or copy operation.
It may be empty if file names is None
.
Implementations§
source§impl ChangeRef<'_>
impl ChangeRef<'_>
Lifecycle
sourcepub fn into_owned(self) -> Change
pub fn into_owned(self) -> Change
Copy this instance into a fully-owned version
Trait Implementations§
impl<'a> Copy for ChangeRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ChangeRef<'a>
impl<'a> RefUnwindSafe for ChangeRef<'a>
impl<'a> Send for ChangeRef<'a>
impl<'a> Sync for ChangeRef<'a>
impl<'a> Unpin for ChangeRef<'a>
impl<'a> UnwindSafe for ChangeRef<'a>
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
)