IndexEntry

Struct IndexEntry 

Source
pub struct IndexEntry { /* private fields */ }
Expand description

An entry in the Git index.

Each entry represents a file that is staged for the next commit.

Implementations§

Source§

impl IndexEntry

Source

pub fn new( ctime: u64, mtime: u64, dev: u32, ino: u32, mode: FileMode, uid: u32, gid: u32, size: u32, oid: Oid, path: PathBuf, stage: u8, ) -> Self

Creates a new IndexEntry.

Source

pub fn ctime(&self) -> u64

Returns the ctime (metadata change time) in seconds since epoch.

Source

pub fn mtime(&self) -> u64

Returns the mtime (modification time) in seconds since epoch.

Source

pub fn dev(&self) -> u32

Returns the device ID.

Source

pub fn ino(&self) -> u32

Returns the inode number.

Source

pub fn mode(&self) -> FileMode

Returns the file mode.

Source

pub fn uid(&self) -> u32

Returns the user ID.

Source

pub fn gid(&self) -> u32

Returns the group ID.

Source

pub fn size(&self) -> u32

Returns the file size in bytes.

Source

pub fn oid(&self) -> &Oid

Returns the object ID (SHA-1 hash) of the blob.

Source

pub fn path(&self) -> &Path

Returns the path of the file relative to the repository root.

Source

pub fn stage(&self) -> u8

Returns the stage number.

  • 0: Normal entry
  • 1: Base version in a merge conflict
  • 2: “Ours” version in a merge conflict
  • 3: “Theirs” version in a merge conflict
Source

pub fn is_conflicted(&self) -> bool

Returns true if this entry is in a merge conflict.

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