pub struct Metadata {
Show 14 fields pub dev: usize, pub inode: usize, pub size: usize, pub blk_size: usize, pub blocks: usize, pub atime: Timespec, pub mtime: Timespec, pub ctime: Timespec, pub type_: FileType, pub mode: u16, pub nlinks: usize, pub uid: usize, pub gid: usize, pub rdev: usize,
}
Expand description

Metadata of INode

Ref: [http://pubs.opengroup.org/onlinepubs/009604499/basedefs/sys/stat.h.html]

Fields

dev: usize

Device ID

inode: usize

Inode number

size: usize

Size in bytes

SFS Note: for normal file size is the actuate file size for directory this is count of dirent.

blk_size: usize

A file system-specific preferred I/O block size for this object. In some file system types, this may vary from file to file.

blocks: usize

Size in blocks

atime: Timespec

Time of last access

mtime: Timespec

Time of last modification

ctime: Timespec

Time of last change

type_: FileType

Type of file

mode: u16

Permission

nlinks: usize

Number of hard links

SFS Note: different from linux, “.” and “..” count in nlinks this is same as original ucore.

uid: usize

User ID

gid: usize

Group ID

rdev: usize

Raw device id e.g. /dev/null: makedev(0x1, 0x3)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Casts the value.

Casts the value.

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Performs the conversion.

Casts the value.

Casts the value.

Casts the value.

Casts the value.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

Casts the value.

Casts the value.

Casts the value.