pub trait Directory: File + DirectoryReadwhere
<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§
Sourcefn add_entry(
&mut self,
name: UnixStr<'_>,
file_type: Type,
permissions: Permissions,
user_id: Uid,
group_id: Gid,
) -> Result<TypeWithFile<Self>, Error<Self::FsError>>
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.
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.