Struct gix_index::Entry

source ·
pub struct Entry {
    pub stat: Stat,
    pub id: ObjectId,
    pub flags: Flags,
    pub mode: Mode,
    /* private fields */
}
Expand description

An entry in the index, identifying a non-tree item on disk.

Fields§

§stat: Stat

The filesystem stat information for the file on disk.

§id: ObjectId

The object id for this entry’s ODB representation (assuming it’s up-to-date with it).

§flags: Flags

Additional flags for use in algorithms and for efficiently storing stage information.

§mode: Mode

The kind of item this entry represents - it’s not all blobs in the index anymore.

Implementations§

source§

impl Entry

source

pub fn write_to(&self, out: impl Write, state: &State) -> Result<()>

Serialize ourselves to out with path access via state, without padding.

source§

impl Entry

source

pub fn path<'a>(&self, state: &'a State) -> &'a BStr

Return an entry’s path, relative to the repository, which is extracted from its owning state.

source

pub fn path_in<'backing>( &self, backing: &'backing PathStorageRef, ) -> &'backing BStr

Return an entry’s path using the given backing.

source

pub fn stage(&self) -> Stage

Return an entry’s stage. See entry::Stage for possible values.

source

pub fn stage_raw(&self) -> u32

Return an entry’s stage as raw number between 0 and 4. Possible values are:

  • 0 = no conflict,
  • 1 = base,
  • 2 = ours,
  • 3 = theirs
source§

impl Entry

source

pub fn cmp(&self, other: &Self, state: &State) -> Ordering

Compare one entry to another by their path, by comparing only their common path portion byte by byte, then resorting to entry length and stage.

source

pub fn cmp_filepaths(a: &BStr, b: &BStr) -> Ordering

Compare one entry to another by their path, by comparing only their common path portion byte by byte, then resorting to entry length.

Trait Implementations§

source§

impl Clone for Entry

source§

fn clone(&self) -> Entry

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 Debug for Entry

source§

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

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

impl PartialEq for Entry

source§

fn eq(&self, other: &Entry) -> 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 Eq for Entry

source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

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§

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

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.