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 { ... }
fn list_extended_attributes(
&self,
) -> impl Future<Output = Result<Vec<Vec<u8>>, Status>> + Send
where Self: Sized { ... }
fn get_extended_attribute(
&self,
_name: Vec<u8>,
) -> impl Future<Output = Result<Vec<u8>, Status>> + Send
where Self: Sized { ... }
fn set_extended_attribute(
&self,
_name: Vec<u8>,
_value: Vec<u8>,
_mode: SetExtendedAttributeMode,
) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized { ... }
fn remove_extended_attribute(
&self,
_name: Vec<u8>,
) -> 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.
Sourcefn rename(
self: Arc<Self>,
_src_dir: Arc<dyn MutableDirectory>,
_src_name: Path,
_dst_name: Path,
) -> BoxFuture<'static, Result<(), Status>>
fn rename( self: Arc<Self>, _src_dir: Arc<dyn MutableDirectory>, _src_name: Path, _dst_name: Path, ) -> BoxFuture<'static, Result<(), Status>>
Renames into this directory.
Sourcefn create_symlink(
&self,
_name: String,
_target: Vec<u8>,
_connection: Option<ServerEnd<SymlinkMarker>>,
) -> impl Future<Output = Result<(), Status>> + Sendwhere
Self: Sized,
fn create_symlink(
&self,
_name: String,
_target: Vec<u8>,
_connection: Option<ServerEnd<SymlinkMarker>>,
) -> impl Future<Output = Result<(), Status>> + Sendwhere
Self: Sized,
Creates a symbolic link.
Sourcefn list_extended_attributes(
&self,
) -> impl Future<Output = Result<Vec<Vec<u8>>, Status>> + Sendwhere
Self: Sized,
fn list_extended_attributes(
&self,
) -> impl Future<Output = Result<Vec<Vec<u8>>, Status>> + Sendwhere
Self: Sized,
List extended attributes.
Sourcefn get_extended_attribute(
&self,
_name: Vec<u8>,
) -> impl Future<Output = Result<Vec<u8>, Status>> + Sendwhere
Self: Sized,
fn get_extended_attribute(
&self,
_name: Vec<u8>,
) -> impl Future<Output = Result<Vec<u8>, Status>> + Sendwhere
Self: Sized,
Get the value for an extended attribute.