Struct gix::index::Entry

source ·
pub struct Entry {
    pub stat: Stat,
    pub id: ObjectId,
    pub flags: Flags,
    pub mode: Mode,
    /* private fields */
}
Available on crate feature index only.
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<(), Error>

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 [u8]) -> &'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: &Entry, 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<(), Error>

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<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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
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.