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
impl Entry
Sourcepub fn path<'a>(&self, state: &'a State) -> &'a BStr
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
.
Sourcepub fn path_in<'backing>(
&self,
backing: &'backing PathStorageRef,
) -> &'backing BStr
pub fn path_in<'backing>( &self, backing: &'backing PathStorageRef, ) -> &'backing BStr
Return an entry’s path using the given backing
.
Sourcepub fn stage(&self) -> Stage
pub fn stage(&self) -> Stage
Return an entry’s stage. See entry::Stage for possible values.
Source§impl Entry
impl Entry
Sourcepub fn cmp(&self, other: &Self, state: &State) -> Ordering
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.
Sourcepub fn cmp_filepaths(a: &BStr, b: &BStr) -> Ordering
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.