pub enum Entry<'index, ContentChange, SubmoduleStatus> {
    Modification {
        entries: &'index [Entry],
        entry: &'index Entry,
        entry_index: usize,
        rela_path: &'index BStr,
        status: EntryStatus<ContentChange, SubmoduleStatus>,
    },
    DirectoryContents {
        entry: Entry,
        collapsed_directory_status: Option<Status>,
    },
    Rewrite {
        source: RewriteSource<'index, ContentChange, SubmoduleStatus>,
        dirwalk_entry: Entry,
        dirwalk_entry_collapsed_directory_status: Option<Status>,
        dirwalk_entry_id: ObjectId,
        diff: Option<DiffLineStats>,
        copy: bool,
    },
}
Available on crate feature worktree-rewrites only.
Expand description

An ‘entry’ in the sense of a merge of modified tracked files and results from a directory walk.

Variants§

§

Modification

A tracked file was modified, and index-specific information is passed.

Fields

§entries: &'index [Entry]

All entries in the index.

§entry: &'index Entry

The entry with modifications.

§entry_index: usize

The index of the entry for lookup in entries - useful to look at neighbors.

§rela_path: &'index BStr

The repository-relative path of the entry.

§status: EntryStatus<ContentChange, SubmoduleStatus>

The computed status of the entry.

§

DirectoryContents

An entry returned by the directory walk, without any relation to the index.

This can happen if ignored files are returned as well, or if rename-tracking is disabled.

Fields

§entry: Entry

The entry found during the disk traversal.

§collapsed_directory_status: Option<Status>

collapsed_directory_status is Some(dir_status) if this entry was part of a directory with the given dir_status that wasn’t the same as the one of entry and if gix_dir::walk::Options::emit_collapsed was CollapsedEntriesEmissionMode::OnStatusMismatch. It will also be Some(dir_status) if that option was CollapsedEntriesEmissionMode::All.

§

Rewrite

The rewrite tracking discovered a match between a deleted and added file, and considers them equal enough, depending on the tracker settings.

Note that the source of the rewrite is always the index as it detects the absence of entries, something that can’t be done during a directory walk.

Fields

§source: RewriteSource<'index, ContentChange, SubmoduleStatus>

The source of the rewrite operation.

§dirwalk_entry: Entry

The untracked entry found during the disk traversal, the destination of the rewrite.

Note that its rela_path is the destination of the rewrite, and the current location of the entry.

§dirwalk_entry_collapsed_directory_status: Option<Status>

collapsed_directory_status is Some(dir_status) if this dirwalk_entry was part of a directory with the given dir_status that wasn’t the same as the one of dirwalk_entry and if gix_dir::walk::Options::emit_collapsed was CollapsedEntriesEmissionMode::OnStatusMismatch. It will also be Some(dir_status) if that option was CollapsedEntriesEmissionMode::All.

§dirwalk_entry_id: ObjectId

The object id after the rename, specifically hashed in order to determine equality.

§diff: Option<DiffLineStats>

It’s None if the ‘source.id’ is equal to dirwalk_entry_id, as identity made an actual diff computation unnecessary. Otherwise, and if enabled, it’s Some(stats) to indicate how similar both entries were.

§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<ContentChange, SubmoduleStatus> Entry<'_, ContentChange, SubmoduleStatus>

Access

Source

pub fn summary(&self) -> Option<Summary>

Return a summary of the entry as digest of its status, or None if this entry is created from the directory walk and is not untracked, or if it is merely to communicate a needed update to the index entry.

Source

pub fn source_rela_path(&self) -> &BStr

The repository-relative path at which the source of a rewrite is located.

If this isn’t a rewrite, the path is the location of the entry itself.

Source

pub fn destination_rela_path(&self) -> &BStr

The repository-relative path at which the destination of a rewrite is located.

If this isn’t a rewrite, the path is the location of the entry itself.

Trait Implementations§

Source§

impl<'index, ContentChange: Clone, SubmoduleStatus: Clone> Clone for Entry<'index, ContentChange, SubmoduleStatus>

Source§

fn clone(&self) -> Entry<'index, ContentChange, SubmoduleStatus>

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<'index, ContentChange: Debug, SubmoduleStatus: Debug> Debug for Entry<'index, ContentChange, SubmoduleStatus>

Source§

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

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

impl<'index, ContentChange: PartialEq, SubmoduleStatus: PartialEq> PartialEq for Entry<'index, ContentChange, SubmoduleStatus>

Source§

fn eq(&self, other: &Entry<'index, ContentChange, SubmoduleStatus>) -> 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<'index, ContentChange, SubmoduleStatus> StructuralPartialEq for Entry<'index, ContentChange, SubmoduleStatus>

Auto Trait Implementations§

§

impl<'index, ContentChange, SubmoduleStatus> Freeze for Entry<'index, ContentChange, SubmoduleStatus>
where SubmoduleStatus: Freeze, ContentChange: Freeze,

§

impl<'index, ContentChange, SubmoduleStatus> RefUnwindSafe for Entry<'index, ContentChange, SubmoduleStatus>
where SubmoduleStatus: RefUnwindSafe, ContentChange: RefUnwindSafe,

§

impl<'index, ContentChange, SubmoduleStatus> Send for Entry<'index, ContentChange, SubmoduleStatus>
where SubmoduleStatus: Send, ContentChange: Send,

§

impl<'index, ContentChange, SubmoduleStatus> Sync for Entry<'index, ContentChange, SubmoduleStatus>
where SubmoduleStatus: Sync, ContentChange: Sync,

§

impl<'index, ContentChange, SubmoduleStatus> Unpin for Entry<'index, ContentChange, SubmoduleStatus>
where SubmoduleStatus: Unpin, ContentChange: Unpin,

§

impl<'index, ContentChange, SubmoduleStatus> UnwindSafe for Entry<'index, ContentChange, SubmoduleStatus>
where SubmoduleStatus: UnwindSafe, ContentChange: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.