DirectoryRead

Trait DirectoryRead 

Source
pub trait DirectoryRead: Sized + Base {
    type Regular: RegularRead<FsError = <Self as Base>::FsError>;
    type SymbolicLink: SymbolicLinkRead<FsError = <Self as Base>::FsError>;
    type Fifo: FifoRead<FsError = <Self as Base>::FsError>;
    type CharacterDevice: CharacterDeviceRead<FsError = <Self as Base>::FsError>;
    type BlockDevice: BlockDeviceRead<FsError = <Self as Base>::FsError>;
    type Socket: SocketRead<FsError = <Self as Base>::FsError>;

    // Required method
    fn entries(
        &self,
    ) -> Result<Vec<DirectoryEntry<'_, Self>>, Error<Self::FsError>>;

    // Provided methods
    fn entry(
        &self,
        name: UnixStr<'_>,
    ) -> Result<Option<TypeWithFile<Self>>, Error<Self::FsError>> { ... }
    fn parent(&self) -> Result<Self, Error<Self::FsError>> { ... }
}
Expand description

This type can be used alone for read-only filesystems.

Required Associated Types§

Source

type Regular: RegularRead<FsError = <Self as Base>::FsError>

Type of the regular files in the Filesystem this directory belongs to.

Type of the symbolic links in the Filesystem this directory belongs to.

Source

type Fifo: FifoRead<FsError = <Self as Base>::FsError>

Type of the fifo in the Filesystem this directory belongs to.

Source

type CharacterDevice: CharacterDeviceRead<FsError = <Self as Base>::FsError>

Type of the character device in the Filesystem this directory belongs to.

Source

type BlockDevice: BlockDeviceRead<FsError = <Self as Base>::FsError>

Type of the character device in the Filesystem this directory belongs to.

Source

type Socket: SocketRead<FsError = <Self as Base>::FsError>

Type of the UNIX socket in the Filesystem this directory belongs to.

Required Methods§

Source

fn entries(&self) -> Result<Vec<DirectoryEntry<'_, Self>>, Error<Self::FsError>>

Returns the directory entries contained.

No two DirectoryEntry returned can have the same filename.

The result must contain at least the entries . (the current directory) and .. (the parent directory).

§Errors

Returns an Error::IO if the device on which the directory is located could not be read.

Provided Methods§

Source

fn entry( &self, name: UnixStr<'_>, ) -> Result<Option<TypeWithFile<Self>>, Error<Self::FsError>>

Returns the entry with the given name.

§Errors

Returns an Error::IO if the device on which the directory is located could not be read.

Source

fn parent(&self) -> Result<Self, Error<Self::FsError>>

Returns the parent directory.

If self if the root directory, it must return itself.

§Errors

Returns an Error::IO if the device on which the directory is located could not be read.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Dev: Device> DirectoryRead for efs::fs::ext2::file::Directory<Dev>

Available on crate feature ext2 only.
Source§

impl<Dev: Device> DirectoryRead for efs::fs::sfs::file::Directory<Dev>

Available on crate feature sfs only.