vfs::directory::entry_container

Trait MutableDirectory

Source
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§

Source

fn update_attributes( &self, attributes: MutableNodeAttributes, ) -> impl Future<Output = Result<(), Status>> + Send
where 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.

Removes an entry from this directory.

Source

fn sync(&self) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized,

Syncs the directory.

Provided Methods§

Adds a child entry to this directory. If the target exists, it should fail with ZX_ERR_ALREADY_EXISTS.

Source

fn rename( self: Arc<Self>, _src_dir: Arc<dyn MutableDirectory>, _src_name: Path, _dst_name: Path, ) -> BoxFuture<'static, Result<(), Status>>

Renames into this directory.

Creates a symbolic link.

Source

fn list_extended_attributes( &self, ) -> impl Future<Output = Result<Vec<Vec<u8>>, Status>> + Send
where Self: Sized,

List extended attributes.

Source

fn get_extended_attribute( &self, _name: Vec<u8>, ) -> impl Future<Output = Result<Vec<u8>, Status>> + Send
where Self: Sized,

Get the value for an extended attribute.

Source

fn set_extended_attribute( &self, _name: Vec<u8>, _value: Vec<u8>, _mode: SetExtendedAttributeMode, ) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized,

Set the value for an extended attribute.

Source

fn remove_extended_attribute( &self, _name: Vec<u8>, ) -> impl Future<Output = Result<(), Status>> + Send
where Self: Sized,

Remove the value for an extended attribute.

Implementors§