Struct git_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.

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

source§

impl StructuralPartialEq for Entry

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

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

§

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

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.