Struct Dirent64

Source
#[repr(C)]
pub struct Dirent64 { pub ino: u64, pub off: i64, pub reclen: u16, pub ftype: u8, pub name: [u8; 0], }
Expand description

表示目录项(dirent)的结构体,用于读取目录内容(如 getdents64)

MUSL: https://github.com/bminor/musl/blob/c47ad25ea3b484e10326f933e927c0bc8cded3da/arch/generic/bits/dirent.h#L5C1-L11C3

Fields§

§ino: u64

inode 号(索引节点号),唯一标识文件

§off: i64

偏移量,指向下一个目录项在目录流中的位置(用于遍历)

§reclen: u16

当前目录项结构体的长度(包括文件名),单位是字节

§ftype: u8

文件类型(如常规文件、目录、符号链接等)

§name: [u8; 0]

文件名(不定长,以空字符结尾,声明为 0 长度数组便于动态追加)

Auto Trait Implementations§

§

impl Freeze for Dirent64

§

impl RefUnwindSafe for Dirent64

§

impl Send for Dirent64

§

impl Sync for Dirent64

§

impl Unpin for Dirent64

§

impl UnwindSafe for Dirent64

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.