pub struct Stat {
pub mtime: Time,
pub ctime: Time,
pub dev: u32,
pub ino: u32,
pub uid: u32,
pub gid: u32,
pub size: u32,
}
Expand description
An entry’s filesystem stat information.
Fields§
§mtime: Time
Modification time
ctime: Time
Creation time
dev: u32
Device number
ino: u32
Inode number
uid: u32
User id of the owner
gid: u32
Group id of the owning group
size: u32
The size of bytes on disk. Capped to u32 so files bigger than that will need thorough additional checking
Implementations§
source§impl Stat
impl Stat
sourcepub fn is_racy(&self, timestamp: FileTime, _: Options) -> bool
pub fn is_racy(&self, timestamp: FileTime, _: Options) -> bool
Detect whether this stat entry is racy if stored in a file index with timestamp
.
An index entry is considered racy if it’s mtime
is larger or equal to the index timestamp
.
The index timestamp
marks the point in time before which we definitely resolved the racy git problem
for all index entries so any index entries that changed afterwards will need to be examined for
changes by actually reading the file from disk at least once.
sourcepub fn matches(&self, other: &Self, _: Options) -> bool
pub fn matches(&self, other: &Self, _: Options) -> bool
Compares the stat information of two index entries.
Intuitively this is basically equivalent to self == other
.
However there a lot of nobs in git that tweak whether certain stat information is used when checking
equality, see Options
.
This function respects those options while performing the stat comparison and may therefore ignore some fields.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Stat
impl<'de> Deserialize<'de> for Stat
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Ord for Stat
impl Ord for Stat
source§impl PartialEq for Stat
impl PartialEq for Stat
source§impl PartialOrd for Stat
impl PartialOrd for Stat
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Stat
impl Eq for Stat
impl StructuralPartialEq for Stat
Auto Trait Implementations§
impl Freeze for Stat
impl RefUnwindSafe for Stat
impl Send for Stat
impl Sync for Stat
impl Unpin for Stat
impl UnwindSafe for Stat
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)