pub trait DirectlyMutable:
Directory
+ Send
+ Sync {
// Required methods
fn add_entry_impl(
&self,
name: Name,
entry: Arc<dyn DirectoryEntry>,
overwrite: bool,
) -> Result<(), AlreadyExists>;
fn remove_entry_impl(
&self,
name: Name,
must_be_directory: bool,
) -> Result<Option<Arc<dyn DirectoryEntry>>, NotDirectory>;
// Provided methods
fn add_entry<NameT>(
&self,
name: NameT,
entry: Arc<dyn DirectoryEntry>,
) -> Result<(), Status>
where NameT: Into<String>,
Self: Sized { ... }
fn add_entry_may_overwrite<NameT>(
&self,
name: NameT,
entry: Arc<dyn DirectoryEntry>,
overwrite: bool,
) -> Result<(), Status>
where NameT: Into<String>,
Self: Sized { ... }
fn remove_entry<NameT>(
&self,
name: NameT,
must_be_directory: bool,
) -> Result<Option<Arc<dyn DirectoryEntry>>, Status>
where NameT: Into<String>,
Self: Sized { ... }
}Expand description
DirectlyMutable is a superset of MutableDirectory which also allows server-side management
of directory entries (via add_entry and remove_entry).
Required Methods§
Sourcefn add_entry_impl(
&self,
name: Name,
entry: Arc<dyn DirectoryEntry>,
overwrite: bool,
) -> Result<(), AlreadyExists>
fn add_entry_impl( &self, name: Name, entry: Arc<dyn DirectoryEntry>, overwrite: bool, ) -> Result<(), AlreadyExists>
Adds a child entry to this directory.
Sourcefn remove_entry_impl(
&self,
name: Name,
must_be_directory: bool,
) -> Result<Option<Arc<dyn DirectoryEntry>>, NotDirectory>
fn remove_entry_impl( &self, name: Name, must_be_directory: bool, ) -> Result<Option<Arc<dyn DirectoryEntry>>, NotDirectory>
Removes a child entry from this directory. In case an entry with the matching name was found, the entry will be returned to the caller.
Provided Methods§
Sourcefn add_entry<NameT>(
&self,
name: NameT,
entry: Arc<dyn DirectoryEntry>,
) -> Result<(), Status>
fn add_entry<NameT>( &self, name: NameT, entry: Arc<dyn DirectoryEntry>, ) -> Result<(), Status>
Adds a child entry to this directory.
Possible errors are:
ZX_ERR_INVALID_ARGSorZX_ERR_BAD_PATHifnameis not a validName.ZX_ERR_ALREADY_EXISTSif an entry with the same name is already present in the directory.
Sourcefn add_entry_may_overwrite<NameT>(
&self,
name: NameT,
entry: Arc<dyn DirectoryEntry>,
overwrite: bool,
) -> Result<(), Status>
fn add_entry_may_overwrite<NameT>( &self, name: NameT, entry: Arc<dyn DirectoryEntry>, overwrite: bool, ) -> Result<(), Status>
Adds a child entry to this directory. If overwrite is true, this function may overwrite
an existing entry.
Possible errors are:
ZX_ERR_INVALID_ARGSorZX_ERR_BAD_PATHifnameis not a validName.ZX_ERR_ALREADY_EXISTSif an entry with the same name is already present in the directory andoverwriteis false.
Sourcefn remove_entry<NameT>(
&self,
name: NameT,
must_be_directory: bool,
) -> Result<Option<Arc<dyn DirectoryEntry>>, Status>
fn remove_entry<NameT>( &self, name: NameT, must_be_directory: bool, ) -> Result<Option<Arc<dyn DirectoryEntry>>, Status>
Removes a child entry from this directory. In case an entry with the matching name was
found, the entry will be returned to the caller. If must_be_directory is true, an error
is returned if the entry is not a directory.
Possible errors are:
ZX_ERR_INVALID_ARGSorZX_ERR_BAD_PATHifnameis not a validName.ZX_ERR_NOT_DIRif the entry identified bynameis not a directory andmust_be_directoryis true.