Struct fuchsia_fatfs::FatDirectory
source · 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 open2(
self: Arc<Self>,
scope: ExecutionScope,
path: Path,
protocols: ConnectionProtocols,
object_request: ObjectRequestRef<'_>
) -> Result<(), Status>
fn open2( self: Arc<Self>, scope: ExecutionScope, path: Path, protocols: ConnectionProtocols, 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§fn read_dirents<'a, 'async_trait>(
&'a self,
pos: &'a TraversalPosition,
sink: Box<dyn Sink>
) -> Pin<Box<dyn Future<Output = Result<(TraversalPosition, Box<dyn Sealed>), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn read_dirents<'a, 'async_trait>(
&'a self,
pos: &'a TraversalPosition,
sink: Box<dyn Sink>
) -> Pin<Box<dyn Future<Output = Result<(TraversalPosition, Box<dyn Sealed>), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
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§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§fn unlink<'life0, 'async_trait>(
self: Arc<Self>,
name: &'life0 str,
must_be_directory: bool
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unlink<'life0, 'async_trait>(
self: Arc<Self>,
name: &'life0 str,
must_be_directory: bool
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes an entry from this directory.
source§fn set_attrs<'life0, 'async_trait>(
&'life0 self,
flags: NodeAttributeFlags,
attrs: NodeAttributes
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_attrs<'life0, 'async_trait>(
&'life0 self,
flags: NodeAttributeFlags,
attrs: NodeAttributes
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the attributes of this directory based on the values in
attrs
.source§fn update_attributes<'life0, 'async_trait>(
&'life0 self,
_attributes: MutableNodeAttributes
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_attributes<'life0, 'async_trait>(
&'life0 self,
_attributes: MutableNodeAttributes
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the mutable attributes of this directory based on the values in
attributes
.source§fn sync<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Syncs the directory.
source§fn rename<'async_trait>(
self: Arc<Self>,
src_dir: Arc<dyn MutableDirectory>,
src_path: Path,
dst_path: Path
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
fn rename<'async_trait>(
self: Arc<Self>,
src_dir: Arc<dyn MutableDirectory>,
src_path: Path,
dst_path: Path
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
Renames into this directory.
§fn link<'life0, 'async_trait>(
self: Arc<Self>,
_name: String,
_source_dir: Arc<dyn Any + Sync + Send>,
_source_name: &'life0 str
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn link<'life0, 'async_trait>(
self: Arc<Self>,
_name: String,
_source_dir: Arc<dyn Any + Sync + Send>,
_source_name: &'life0 str
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Adds a child entry to this directory. If the target exists, it should fail with
ZX_ERR_ALREADY_EXISTS.
§fn create_symlink<'life0, 'async_trait>(
&'life0 self,
_name: String,
_target: Vec<u8>,
_connection: Option<ServerEnd<SymlinkMarker>>
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn create_symlink<'life0, 'async_trait>(
&'life0 self,
_name: String,
_target: Vec<u8>,
_connection: Option<ServerEnd<SymlinkMarker>>
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Creates a symbolic link.
§fn list_extended_attributes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_extended_attributes<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
List extended attributes.
§fn get_extended_attribute<'life0, 'async_trait>(
&'life0 self,
_name: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_extended_attribute<'life0, 'async_trait>(
&'life0 self,
_name: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get the value for an extended attribute.
source§impl Node for FatDirectory
impl Node for FatDirectory
source§fn get_attrs<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<NodeAttributes, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_attrs<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<NodeAttributes, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get this node’s attributes.
source§fn get_attributes<'life0, 'async_trait>(
&'life0 self,
requested_attributes: NodeAttributesQuery
) -> Pin<Box<dyn Future<Output = Result<NodeAttributes2, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_attributes<'life0, 'async_trait>(
&'life0 self,
requested_attributes: NodeAttributesQuery
) -> Pin<Box<dyn Future<Output = Result<NodeAttributes2, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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<'async_trait>(
self: Arc<Self>,
_destination_dir: Arc<dyn MutableDirectory>,
_name: Name
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
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