gix_diff::index

Type Alias Change

Source
pub type Change = ChangeRef<'static, 'static>;
Available on crate feature index only.
Expand description

The fully-owned version of ChangeRef.

Aliased Type§

enum Change {
    Addition {
        location: Cow<'static, BStr>,
        index: usize,
        entry_mode: Mode,
        id: Cow<'static, oid>,
    },
    Deletion {
        location: Cow<'static, BStr>,
        index: usize,
        entry_mode: Mode,
        id: Cow<'static, oid>,
    },
    Modification {
        location: Cow<'static, BStr>,
        previous_index: usize,
        previous_entry_mode: Mode,
        previous_id: Cow<'static, oid>,
        index: usize,
        entry_mode: Mode,
        id: Cow<'static, oid>,
    },
    Rewrite {
        source_location: Cow<'static, BStr>,
        source_index: usize,
        source_entry_mode: Mode,
        source_id: Cow<'static, oid>,
        location: Cow<'static, BStr>,
        index: usize,
        entry_mode: Mode,
        id: Cow<'static, oid>,
        copy: bool,
    },
}

Variants§

§

Addition

An entry was added to rhs.

Fields

§location: Cow<'static, BStr>

The location of the newly added entry in rhs.

§index: usize

The index into the entries array of rhs for full access.

§entry_mode: Mode

The mode of the entry in rhs.

§id: Cow<'static, oid>

The object id of the entry in rhs.

§

Deletion

An entry was removed from rhs.

Fields

§location: Cow<'static, BStr>

The location the entry that doesn’t exist in rhs.

§index: usize

The index into the entries array of lhs for full access.

§entry_mode: Mode

The mode of the entry in lhs.

§id: Cow<'static, oid>

The object id of the entry in lhs.

§

Modification

An entry was modified, i.e. has changed its content or its mode.

Fields

§location: Cow<'static, BStr>

The location of the modified entry both in lhs and rhs.

§previous_index: usize

The index into the entries array of lhs for full access.

§previous_entry_mode: Mode

The previous mode of the entry, in lhs.

§previous_id: Cow<'static, oid>

The previous object id of the entry, in lhs.

§index: usize

The index into the entries array of rhs for full access.

§entry_mode: Mode

The mode of the entry in rhs.

§id: Cow<'static, oid>

The object id of the entry in rhs.

§

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<'static, BStr>

The location of the source of the rename or copy operation, in lhs.

§source_index: usize

The index of the entry before the rename, into the entries array of rhs for full access.

§source_entry_mode: Mode

The mode of the entry before the rewrite, in lhs.

§source_id: Cow<'static, 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.

§location: Cow<'static, BStr>

The current location of the entry in rhs.

§index: usize

The index of the entry after the rename, into the entries array of rhs for full access.

§entry_mode: Mode

The mode of the entry after the rename in rhs.

§id: Cow<'static, oid>

The object id of the entry after the rename in rhs.

§copy: bool

If true, this rewrite is created by copy, and source_id is pointing to its source. Otherwise, it’s a rename, and source_id points to a deleted object, as renames are tracked as deletions and additions of the same or similar content.