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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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> 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,

§

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>,

§

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>,

§

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.