pub struct FatDirectory { /* private fields */ }
Expand description
This wraps a directory on the FAT volume.
Implementations§
Source§impl FatDirectory
impl FatDirectory
Sourcepub fn remove_child(
&self,
fs: &FatFilesystemInner,
name: &str,
) -> Option<FatNode>
pub fn remove_child( &self, fs: &FatFilesystemInner, name: &str, ) -> Option<FatNode>
Remove and detach a child node from this FatDirectory, returning it if it exists in the cache. The caller must ensure that the corresponding filesystem entry is removed to prevent the item being added back to the cache, and must later attach() the returned node somewhere.
Sourcepub fn add_child(
self: &Arc<Self>,
fs: &FatFilesystemInner,
name: String,
child: FatNode,
) -> Result<(), Status>
pub fn add_child( self: &Arc<Self>, fs: &FatFilesystemInner, name: String, child: FatNode, ) -> Result<(), Status>
Add and attach a child node to this FatDirectory. The caller needs to make sure that the entry corresponds to a node on the filesystem, and that there is no existing entry with that name in the cache.
Trait Implementations§
Source§impl Debug for FatDirectory
impl Debug for FatDirectory
Source§impl Directory for FatDirectory
impl Directory for FatDirectory
Source§fn open(
self: Arc<Self>,
scope: ExecutionScope,
flags: OpenFlags,
path: Path,
server_end: ServerEnd<NodeMarker>,
)
fn open( self: Arc<Self>, scope: ExecutionScope, flags: OpenFlags, path: Path, server_end: ServerEnd<NodeMarker>, )
Opens a connection to this item if the
path
is “.” or a connection to an item inside this
one otherwise. path
will not contain any “.” or “..” components. Read moreSource§fn open3(
self: Arc<Self>,
scope: ExecutionScope,
path: Path,
flags: Flags,
object_request: ObjectRequestRef<'_>,
) -> Result<(), Status>
fn open3( self: Arc<Self>, scope: ExecutionScope, path: Path, flags: Flags, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>
Opens a connection to this item if the
path
is “.” or a connection to an item inside
this one otherwise. path
will not contain any “.” or “..” components. Read moreSource§async fn read_dirents<'a>(
&'a self,
pos: &'a TraversalPosition,
sink: Box<dyn Sink>,
) -> Result<(TraversalPosition, Box<dyn Sealed>), Status>
async fn read_dirents<'a>( &'a self, pos: &'a TraversalPosition, sink: Box<dyn Sink>, ) -> Result<(TraversalPosition, Box<dyn Sealed>), Status>
Reads directory entries starting from
pos
by adding them to sink
.
Once finished, should return a sealed sink.Source§fn register_watcher(
self: Arc<Self>,
scope: ExecutionScope,
mask: WatchMask,
watcher: DirectoryWatcher,
) -> Result<(), Status>
fn register_watcher( self: Arc<Self>, scope: ExecutionScope, mask: WatchMask, watcher: DirectoryWatcher, ) -> Result<(), Status>
Register a watcher for this directory.
Implementations will probably want to use a
Watcher
to manage watchers.Source§fn unregister_watcher(self: Arc<Self>, key: usize)
fn unregister_watcher(self: Arc<Self>, key: usize)
Unregister a watcher from this directory. The watcher should no longer
receive events.
Source§impl DirectoryEntry for FatDirectory
impl DirectoryEntry for FatDirectory
Source§impl GetEntryInfo for FatDirectory
impl GetEntryInfo for FatDirectory
Source§fn entry_info(&self) -> EntryInfo
fn entry_info(&self) -> EntryInfo
This method is used to populate ReadDirents() output.
Source§impl MutableDirectory for FatDirectory
impl MutableDirectory for FatDirectory
Source§async fn unlink(
self: Arc<Self>,
name: &str,
must_be_directory: bool,
) -> Result<(), Status>
async fn unlink( self: Arc<Self>, name: &str, must_be_directory: bool, ) -> Result<(), Status>
Removes an entry from this directory.
Source§async fn update_attributes(
&self,
attributes: MutableNodeAttributes,
) -> Result<(), Status>
async fn update_attributes( &self, attributes: MutableNodeAttributes, ) -> Result<(), Status>
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
.Source§fn rename(
self: Arc<Self>,
src_dir: Arc<dyn MutableDirectory>,
src_path: Path,
dst_path: Path,
) -> BoxFuture<'static, Result<(), Status>>
fn rename( self: Arc<Self>, src_dir: Arc<dyn MutableDirectory>, src_path: Path, dst_path: Path, ) -> BoxFuture<'static, Result<(), Status>>
Renames into this directory.
§fn link<'a>(
self: Arc<Self>,
_name: String,
_source_dir: Arc<dyn Any + Send + Sync>,
_source_name: &'a str,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'a>>
fn link<'a>( self: Arc<Self>, _name: String, _source_dir: Arc<dyn Any + Send + Sync>, _source_name: &'a str, ) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'a>>
Adds a child entry to this directory. If the target exists, it should fail with
ZX_ERR_ALREADY_EXISTS.
§fn 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.
§fn 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.
§fn 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.
Source§impl Node for FatDirectory
impl Node for FatDirectory
Source§async fn get_attributes(
&self,
requested_attributes: NodeAttributesQuery,
) -> Result<NodeAttributes2, Status>
async fn get_attributes( &self, requested_attributes: NodeAttributesQuery, ) -> Result<NodeAttributes2, Status>
Returns node attributes (io2).
Source§fn query_filesystem(&self) -> Result<FilesystemInfo, Status>
fn query_filesystem(&self) -> Result<FilesystemInfo, Status>
Returns information about the filesystem.
Source§fn will_clone(&self)
fn will_clone(&self)
Called when the node is about to be cloned (and also by the default implementation of
will_open_as_node). Implementations that perform their own open count can use this. Each
call to
will_clone
will be accompanied by an eventual call to close
.§fn will_open_as_node(&self) -> Result<(), Status>
fn will_open_as_node(&self) -> Result<(), Status>
Called when the node is about to be opened as the node protocol. Implementers can use this
to perform any initialization or reference counting. Errors here will result in the open
failing. By default, this forwards to the infallible will_clone.
fn link_into(
self: Arc<Self>,
_destination_dir: Arc<dyn MutableDirectory>,
_name: Name,
) -> impl Future<Output = Result<(), Status>> + Sendwhere
Self: Sized,
impl Send for FatDirectory
impl Sync for FatDirectory
Auto Trait Implementations§
impl !Freeze for FatDirectory
impl !RefUnwindSafe for FatDirectory
impl Unpin for FatDirectory
impl !UnwindSafe for FatDirectory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more