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.

Implementations

Source§

impl ChangeRef<'_, '_>

Source

pub fn into_owned(self) -> Change

Copy everything into an owned version of this instance.

Source§

impl ChangeRef<'_, '_>

Source

pub fn fields(&self) -> (&BStr, usize, Mode, &oid)

Return all shared fields among all variants: (location, index, entry_mode, id)

In case of rewrites, the fields return to the current change.

Trait Implementations

Source§

impl Change for ChangeRef<'_, '_>

Source§

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>

Available on crate feature blob only.
Return the relation that this change may have with other changes. Read more
Source§

fn kind(&self) -> ChangeKind

Available on crate feature blob only.
Return the kind of this change.
Source§

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)

Available on crate feature blob only.
Return the id of the change along with its mode.
Source§

impl<'lhs, 'rhs> Clone for ChangeRef<'lhs, 'rhs>

Source§

fn clone(&self) -> ChangeRef<'lhs, 'rhs>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'lhs, 'rhs> Debug for ChangeRef<'lhs, 'rhs>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'lhs, 'rhs> PartialEq for ChangeRef<'lhs, 'rhs>

Source§

fn eq(&self, other: &ChangeRef<'lhs, 'rhs>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'lhs, 'rhs> Eq for ChangeRef<'lhs, 'rhs>

Source§

impl<'lhs, 'rhs> StructuralPartialEq for ChangeRef<'lhs, 'rhs>