gix_status::index_as_worktree_with_renames

Enum RewriteSource

Source
pub enum RewriteSource<'index, ContentChange, SubmoduleStatus> {
    RewriteFromIndex {
        index_entries: &'index [Entry],
        source_entry: &'index Entry,
        source_entry_index: usize,
        source_rela_path: &'index BStr,
        source_status: EntryStatus<ContentChange, SubmoduleStatus>,
    },
    CopyFromDirectoryEntry {
        source_dirwalk_entry: Entry,
        source_dirwalk_entry_collapsed_directory_status: Option<Status>,
        source_dirwalk_entry_id: ObjectId,
    },
}
Available on crate feature worktree-rewrites only.
Expand description

Either an index entry for renames or another directory entry in case of copies.

Variants§

§

RewriteFromIndex

The source originates in the index and is detected as missing in the working tree. This can also happen for copies.

Fields

§index_entries: &'index [Entry]

All entries in the index.

§source_entry: &'index Entry

The entry that is the source of the rewrite, which means it was removed on disk, equivalent to Change::Removed.

Note that the entry-id is the content-id of the source of the rewrite.

§source_entry_index: usize

The index of the source_entry for lookup in index_entries - useful to look at neighbors.

§source_rela_path: &'index BStr

The repository-relative path of the source_entry.

§source_status: EntryStatus<ContentChange, SubmoduleStatus>

The computed status of the source_entry.

§

CopyFromDirectoryEntry

This source originates in the directory tree and is always the source of copies.

Fields

§source_dirwalk_entry: Entry

The source of the copy operation, which is also an entry of the directory walk.

Note that its rela_path is the source of the rewrite.

§source_dirwalk_entry_collapsed_directory_status: Option<Status>

collapsed_directory_status is Some(dir_status) if this source_dirwalk_entry was part of a directory with the given dir_status that wasn’t the same as the one of source_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.

§source_dirwalk_entry_id: ObjectId

The object id as it would appear if the entry was written to the object database. It’s the same as dirwalk_entry_id, or diff is Some(_) to indicate that the copy was determined by similarity.

Implementations§

Source§

impl<ContentChange, SubmoduleStatus> RewriteSource<'_, ContentChange, SubmoduleStatus>

Access

Source

pub fn rela_path(&self) -> &BStr

The repository-relative path of this source.

Trait Implementations§

Source§

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

Source§

fn clone(&self) -> RewriteSource<'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 RewriteSource<'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 RewriteSource<'index, ContentChange, SubmoduleStatus>

Source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'index, ContentChange, SubmoduleStatus> UnwindSafe for RewriteSource<'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.