#[non_exhaustive]pub struct Stat {
pub dev: u64,
pub ino: u64,
pub mode: Mode,
pub type: FileType,
pub nlink: u64,
pub uid: Uid,
pub gid: Gid,
pub size: u64,
}Expand description
File status
This type is a collection of file status information. It is similar to the
stat structure defined in the POSIX standard, but it is simplified and
does not include all fields of the stat structure.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.dev: u64Device ID
ino: u64Inode number
mode: ModeAccess permissions
Note that this field does not include the file type bits.
The file type is stored in the type field.
type: FileTypeFile type
nlink: u64Number of hard links
uid: UidUser ID of the file owner
gid: GidGroup ID of the file owner
size: u64Length of the file in bytes
Implementations§
Trait Implementations§
Source§impl Stat for Stat
impl Stat for Stat
Source§fn is_regular_file(&self) -> bool
fn is_regular_file(&self) -> bool
Whether the file is a regular file
Source§fn is_directory(&self) -> bool
fn is_directory(&self) -> bool
Whether the file is a directory
Source§fn is_symlink(&self) -> bool
fn is_symlink(&self) -> bool
Whether the file is a symbolic link
Source§fn is_block_device(&self) -> bool
fn is_block_device(&self) -> bool
Whether the file is a block device
Source§fn is_character_device(&self) -> bool
fn is_character_device(&self) -> bool
Whether the file is a character device
impl 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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more