Directory

Trait Directory 

Source
pub trait Directory: File + DirectoryRead
where <Self as DirectoryRead>::Regular: Regular<FsError = <Self as Base>::FsError>, <Self as DirectoryRead>::SymbolicLink: SymbolicLink<FsError = <Self as Base>::FsError>, <Self as DirectoryRead>::Fifo: Fifo<FsError = <Self as Base>::FsError>, <Self as DirectoryRead>::CharacterDevice: CharacterDevice<FsError = <Self as Base>::FsError>, <Self as DirectoryRead>::BlockDevice: BlockDevice<FsError = <Self as Base>::FsError>, <Self as DirectoryRead>::Socket: Socket<FsError = <Self as Base>::FsError>,
{ // Required methods fn add_entry( &mut self, name: UnixStr<'_>, file_type: Type, permissions: Permissions, user_id: Uid, group_id: Gid, ) -> Result<TypeWithFile<Self>, Error<Self::FsError>>; fn remove_entry( &mut self, name: UnixStr<'_>, ) -> Result<(), Error<Self::FsError>>; }
Expand description

A file that contains directory entries. No two directory entries in the same directory have the same name.

Defined in this POSIX definition.

Required Methods§

Source

fn add_entry( &mut self, name: UnixStr<'_>, file_type: Type, permissions: Permissions, user_id: Uid, group_id: Gid, ) -> Result<TypeWithFile<Self>, Error<Self::FsError>>

Adds a new empty entry to the directory, meaning that a new file will be created.

§Errors

Returns an EntryAlreadyExist error if the entry already exist.

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

Source

fn remove_entry( &mut self, name: UnixStr<'_>, ) -> Result<(), Error<Self::FsError>>

Removes an entry from the directory.

§Errors

Returns an NotFound error if there is no entry with the given name in this directory.

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

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> Directory for Directory<Dev>

Available on crate feature ext2 only.