Skip to main content

VfsFileInfo

Struct VfsFileInfo 

Source
pub struct VfsFileInfo {
Show 14 fields pub ino: u64, pub size: u64, pub blocks: u64, pub block_size: u32, pub mode: u32, pub file_type: VfsFileType, pub nlink: u32, pub uid: u32, pub gid: u32, pub rdev: u64, pub atime: VfsTimestamp, pub mtime: VfsTimestamp, pub ctime: VfsTimestamp, pub crtime: Option<VfsTimestamp>,
}
Expand description

File metadata structure.

Contains all metadata about a file or directory that can be retrieved without reading file contents.

Fields§

§ino: u64

Inode number (unique file identifier within filesystem)

§size: u64

File size in bytes

§blocks: u64

Number of 512-byte blocks allocated

§block_size: u32

Preferred I/O block size

§mode: u32

Unix permission mode (including file type bits)

§file_type: VfsFileType

File type (derived from mode, but cached for convenience)

§nlink: u32

Number of hard links

§uid: u32

Owner user ID

§gid: u32

Owner group ID

§rdev: u64

Device ID (for device files)

§atime: VfsTimestamp

Last access time

§mtime: VfsTimestamp

Last modification time

§ctime: VfsTimestamp

Last status change time (inode change)

§crtime: Option<VfsTimestamp>

Creation/birth time (if supported by filesystem)

Implementations§

Source§

impl VfsFileInfo

Source

pub const fn is_file(&self) -> bool

Check if this is a regular file.

Source

pub const fn is_dir(&self) -> bool

Check if this is a directory.

Check if this is a symbolic link.

Source

pub const fn permissions(&self) -> u32

Get Unix permission bits only (without file type).

Trait Implementations§

Source§

impl Clone for VfsFileInfo

Source§

fn clone(&self) -> VfsFileInfo

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 VfsFileInfo

Source§

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

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

impl Default for VfsFileInfo

Source§

fn default() -> Self

Implements default.

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