pub struct FatDirectory { /* private fields */ }
Expand description

This wraps a directory on the FAT volume.

Implementations§

source§

impl FatDirectory

source

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.

source

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.

source

pub fn cache_get(&self, name: &str) -> Option<FatNode>

Lookup a child entry in the cache.

Trait Implementations§

source§

impl Debug for FatDirectory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Directory for FatDirectory

source§

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 more
source§

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 more
source§

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>

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)

Unregister a watcher from this directory. The watcher should no longer receive events.
source§

impl DirectoryEntry for FatDirectory

source§

fn entry_info(&self) -> EntryInfo

This method is used to populate ReadDirents() output.
source§

fn open_entry(self: Arc<Self>, request: OpenRequest<'_>) -> Result<(), Status>

Opens this entry.
source§

impl MutableDirectory for FatDirectory

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,

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,

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,

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,

Renames into this directory.
Adds a child entry to this directory. If the target exists, it should fail with ZX_ERR_ALREADY_EXISTS.
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,

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,

Get the value for an extended attribute.
§

fn set_extended_attribute<'life0, 'async_trait>( &'life0 self, _name: Vec<u8>, _value: Vec<u8>, _mode: SetExtendedAttributeMode ) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Set the value for an extended attribute.
§

fn remove_extended_attribute<'life0, 'async_trait>( &'life0 self, _name: Vec<u8> ) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Remove the value for an extended attribute.
source§

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,

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,

Returns node attributes (io2).
source§

fn close(self: Arc<Self>)

Called when the node is closed.
source§

fn query_filesystem(&self) -> Result<FilesystemInfo, Status>

Returns information about the filesystem.
source§

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>

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 open_as_node( self: Arc<Self>, scope: ExecutionScope, options: NodeOptions, object_request: &mut ObjectRequest ) -> Result<(), Status>

Opens the node using the node protocol.
source§

impl Send for FatDirectory

source§

impl Sync for FatDirectory

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Encode<Ambiguous1> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> Encode<Ambiguous2> for T

source§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
§

impl<T> IsDirectory for T
where T: DirectoryEntry,

§

fn is_directory(&self) -> bool

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> RootDirectory for T
where T: DirectoryEntry + Directory,