pub trait MutableDirectory:
Directory
+ Send
+ Sync {
// Required methods
fn update_attributes(
&self,
attributes: MutableNodeAttributes,
) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized;
fn unlink(
self: Arc<Self>,
name: &str,
must_be_directory: bool,
) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized;
fn sync(&self) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized;
// Provided methods
fn link<'a>(
self: Arc<Self>,
_name: String,
_source_dir: Arc<dyn Any + Send + Sync>,
_source_name: &'a str,
) -> BoxFuture<'a, Result<(), Status>> { ... }
fn rename(
self: Arc<Self>,
_src_dir: Arc<dyn MutableDirectory>,
_src_name: Path,
_dst_name: Path,
) -> BoxFuture<'static, Result<(), Status>> { ... }
fn create_symlink(
&self,
_name: String,
_target: Vec<u8>,
_connection: Option<ServerEnd<SymlinkMarker>>,
) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized { ... }
}Expand description
This trait indicates a directory that can be mutated by adding and removing entries.
This trait must be implemented to use a MutableConnection, however, a directory could also
implement the DirectlyMutable type, which provides a blanket implementation of this trait.
Required Methods§
Sourcefn update_attributes(
&self,
attributes: MutableNodeAttributes,
) -> impl Future<Output = Result<(), Status>> + Sendwhere
Self: Sized,
fn update_attributes(
&self,
attributes: MutableNodeAttributes,
) -> impl Future<Output = Result<(), Status>> + Sendwhere
Self: Sized,
Set the mutable attributes of this directory based on the values in attributes. If the
directory does not support updating all of the specified attributes, implementations
should fail with ZX_ERR_NOT_SUPPORTED.
Provided Methods§
Sourcefn link<'a>(
self: Arc<Self>,
_name: String,
_source_dir: Arc<dyn Any + Send + Sync>,
_source_name: &'a str,
) -> BoxFuture<'a, Result<(), Status>>
fn link<'a>( self: Arc<Self>, _name: String, _source_dir: Arc<dyn Any + Send + Sync>, _source_name: &'a str, ) -> BoxFuture<'a, Result<(), Status>>
Adds a child entry to this directory. If the target exists, it should fail with ZX_ERR_ALREADY_EXISTS.