Skip to main content

IndexEntry

Struct IndexEntry 

Source
pub struct IndexEntry {
Show 14 fields pub ctime_sec: u32, pub ctime_nsec: u32, pub mtime_sec: u32, pub mtime_nsec: u32, pub dev: u32, pub ino: u32, pub mode: u32, pub uid: u32, pub gid: u32, pub size: u32, pub oid: ObjectId, pub flags: u16, pub flags_extended: Option<u16>, pub path: Vec<u8>,
}
Expand description

A single entry in the Git index.

Fields§

§ctime_sec: u32

Time the file metadata last changed (seconds since epoch).

§ctime_nsec: u32

Nanosecond fraction of ctime_sec.

§mtime_sec: u32

Time the file data last changed (seconds since epoch).

§mtime_nsec: u32

Nanosecond fraction of mtime_sec.

§dev: u32

Device number.

§ino: u32

Inode number.

§mode: u32

Unix file mode (MODE_REGULAR, MODE_EXECUTABLE, MODE_SYMLINK, …).

§uid: u32

Owner UID.

§gid: u32

Owner GID.

§size: u32

File size in bytes (truncated to 32 bits).

§oid: ObjectId

SHA-1 of the blob object.

§flags: u16

Entry flags (stage, assume-valid, extended, …).

§flags_extended: Option<u16>

Extended flags (v3+ only).

§path: Vec<u8>

Path relative to the repository root. May contain / separators.

Implementations§

Source§

impl IndexEntry

Source

pub fn stage(&self) -> u8

Merge stage (0 = normal, 1–3 = conflict stages).

Source

pub fn assume_unchanged(&self) -> bool

Whether the assume-unchanged bit is set.

Source

pub fn skip_worktree(&self) -> bool

Whether the skip-worktree bit is set (extended flags, v3+).

Source

pub fn set_assume_unchanged(&mut self, value: bool)

Set the assume-unchanged bit.

Source

pub fn set_skip_worktree(&mut self, value: bool)

Set the skip-worktree bit (promotes entry to v3).

Source

pub fn intent_to_add(&self) -> bool

Whether the intent-to-add bit is set (extended flags, v3+).

Source

pub fn set_intent_to_add(&mut self, value: bool)

Set the intent-to-add bit (promotes entry to v3).

Trait Implementations§

Source§

impl Clone for IndexEntry

Source§

fn clone(&self) -> IndexEntry

Returns a duplicate 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 IndexEntry

Source§

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

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

impl PartialEq for IndexEntry

Source§

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

Source§

impl StructuralPartialEq for IndexEntry

Auto Trait Implementations§

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

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