pub enum ChangeRef<'lhs, 'rhs> {
Addition {
location: Cow<'rhs, BStr>,
index: usize,
entry_mode: Mode,
id: Cow<'rhs, oid>,
},
Deletion {
location: Cow<'lhs, BStr>,
index: usize,
entry_mode: Mode,
id: Cow<'rhs, oid>,
},
Modification {
location: Cow<'rhs, BStr>,
previous_index: usize,
previous_entry_mode: Mode,
previous_id: Cow<'lhs, oid>,
index: usize,
entry_mode: Mode,
id: Cow<'rhs, oid>,
},
Rewrite {
source_location: Cow<'lhs, BStr>,
source_index: usize,
source_entry_mode: Mode,
source_id: Cow<'lhs, oid>,
location: Cow<'rhs, BStr>,
index: usize,
entry_mode: Mode,
id: Cow<'rhs, oid>,
copy: bool,
},
}Available on crate feature
index only.Expand description
Identify a change that would have to be applied to lhs to obtain rhs, as provided in index().
Variants§
Addition
An entry was added to rhs.
Fields
Deletion
An entry was removed from rhs.
Fields
Modification
An entry was modified, i.e. has changed its content or its mode.
Fields
Rewrite
An entry was renamed or copied from lhs to rhs.
A rename is effectively fusing together the Deletion of the source and the Addition of the destination.
Fields
§
source_location: Cow<'lhs, BStr>The location of the source of the rename or copy operation, in lhs.
§
source_index: usizeThe index of the entry before the rename, into the entries array of rhs for full access.
§
source_id: Cow<'lhs, oid>The object id of the entry before the rewrite.
Note that this is the same as id if we require the similarity to be 100%, but may
be different otherwise.
Implementations§
Trait Implementations§
Source§impl Change for ChangeRef<'_, '_>
impl Change for ChangeRef<'_, '_>
Source§fn id(&self) -> &oid
fn id(&self) -> &oid
Available on crate feature
blob only.Return the hash of the object behind this change for identification. Read more
Source§fn relation(&self) -> Option<Relation>
fn relation(&self) -> Option<Relation>
Available on crate feature
blob only.Return the relation that this change may have with other changes. Read more
Source§fn kind(&self) -> ChangeKind
fn kind(&self) -> ChangeKind
Available on crate feature
blob only.Return the kind of this change.
Source§fn entry_mode(&self) -> EntryMode
fn entry_mode(&self) -> EntryMode
Available on crate feature
blob only.Return more information about the kind of entry affected by this change.
Source§fn id_and_entry_mode(&self) -> (&oid, EntryMode)
fn id_and_entry_mode(&self) -> (&oid, EntryMode)
Available on crate feature
blob only.Return the id of the change along with its mode.
impl<'lhs, 'rhs> Eq for ChangeRef<'lhs, 'rhs>
impl<'lhs, 'rhs> StructuralPartialEq for ChangeRef<'lhs, 'rhs>
Auto Trait Implementations§
impl<'lhs, 'rhs> Freeze for ChangeRef<'lhs, 'rhs>
impl<'lhs, 'rhs> RefUnwindSafe for ChangeRef<'lhs, 'rhs>
impl<'lhs, 'rhs> Send for ChangeRef<'lhs, 'rhs>
impl<'lhs, 'rhs> Sync for ChangeRef<'lhs, 'rhs>
impl<'lhs, 'rhs> Unpin for ChangeRef<'lhs, 'rhs>
impl<'lhs, 'rhs> UnwindSafe for ChangeRef<'lhs, 'rhs>
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