[][src]Struct jwalk::DirEntry

pub struct DirEntry {
    pub depth: usize,
    pub file_name: OsString,
    pub file_type: Result<FileType>,
    pub metadata: Option<Result<Metadata>>,
    pub content_spec: Option<Arc<ReadDirSpec>>,
    pub content_error: Option<Error>,
    pub parent_spec: Option<Arc<ReadDirSpec>>,
}

Representation of a file or directory.

This representation does not wrap a std::fs::DirEntry. Instead it copies file_name, file_type, and optionaly metadata out of the underlying std::fs::DirEntry. This allows it to quickly drop the underlying file descriptor.

Fields

depth: usize

Depth of this entry relative to the root directory where the walk started.

file_name: OsString

File name of this entry without leading path component.

file_type: Result<FileType>

File type result for the file/directory that this entry points at.

metadata: Option<Result<Metadata>>

Metadata result for the file/directory that this entry points at. Defaults to None. Filled in by the walk process when the preload_metadata option is set.

content_spec: Option<Arc<ReadDirSpec>>

ReadDirSpec used for reading this entry's content. This is automatically set for directory entries. The process_entries callback may set this field to None to skip reading the contents of this particular directory.

content_error: Option<Error>

If fs::read_dir generates an error when reading this entry's content then that error is stored here.

parent_spec: Option<Arc<ReadDirSpec>>

ReadDirSpec used by this entry's parent to read this entry.

Methods

impl DirEntry[src]

pub fn path(&self) -> PathBuf[src]

Path to the file/directory represented by this entry.

The path is created by joining parent_path with file_name.

pub fn parent_path(&self) -> Option<&Path>[src]

Reference to the path of the directory containing this entry.

Trait Implementations

impl Debug for DirEntry[src]

Auto Trait Implementations

impl Send for DirEntry

impl Sync for DirEntry

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]