Skip to main content

FxDirectory

Struct FxDirectory 

Source
pub struct FxDirectory { /* private fields */ }

Implementations§

Source§

impl FxDirectory

Source

pub fn directory(&self) -> &Directory<FxVolume>

Source

pub fn volume(&self) -> &Arc<FxVolume>

Source

pub fn store(&self) -> &ObjectStore

Source

pub fn is_deleted(&self) -> bool

Source

pub fn set_deleted(&self)

As per fscrypt, a user cannot link an unencrypted file into an encrypted directory nor can a user link an encrypted file into a directory encrypted with a different key. Appropriate locks must be held by the caller.

Trait Implementations§

Source§

impl Directory for FxDirectory

Source§

fn deprecated_open( self: Arc<Self>, scope: ExecutionScope, flags: OpenFlags, path: Path, server_end: ServerEnd<NodeMarker>, )

DEPRECATED - Do not implement unless required for backwards compatibility. Called when handling a fuchsia.io/Directory.DeprecatedOpen request.
Source§

fn open( 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 more
Source§

async fn open_async( self: Arc<Self>, scope: ExecutionScope, path: Path, flags: Flags, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>

Same as Self::open but the implementation is async. This may be more efficient if the directory needs to do async work to open the connection.
Source§

async fn read_dirents( &self, pos: &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>

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 FxDirectory

Source§

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

Opens this entry.
Source§

fn scope(&self) -> Option<ExecutionScope>

The scope that should own connections to this directory entry, or None if parent scope should be used (the default). Read more
Source§

impl Drop for FxDirectory

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<Directory<FxVolume>> for FxDirectory

Source§

fn from(dir: Directory<FxVolume>) -> Self

Converts to this type from the input type.
Source§

impl FxNode for FxDirectory

Source§

fn object_id(&self) -> u64

Source§

fn parent(&self) -> Option<Arc<FxDirectory>>

Source§

fn set_parent(&self, parent: Arc<FxDirectory>)

Source§

fn open_count_add_one(&self)

Source§

fn open_count_sub_one(self: Arc<Self>)

Atomically check if this brought the count to zero while the node is marked for purge. If so, this must queue the node for tombstone the node.
Source§

fn object_descriptor(&self) -> ObjectDescriptor

Source§

fn mark_to_be_purged(&self)

Marks the object to be purged. Queues the node for tombstone if open count is zero.
Source§

fn terminate(&self)

Called when the filesystem is shutting down. Implementations should break any strong reference cycles that would prevent the node from being dropped.
Source§

impl GetEntryInfo for FxDirectory

Source§

fn entry_info(&self) -> EntryInfo

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

impl MutableDirectory for FxDirectory

Adds a child entry to this directory. If the target exists, it should fail with ZX_ERR_ALREADY_EXISTS.
Removes an entry from this directory.
Source§

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§

async fn sync(&self) -> Result<(), Status>

Syncs the directory.
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§

impl Node for FxDirectory

Source§

async fn get_attributes( &self, requested_attributes: NodeAttributesQuery, ) -> Result<NodeAttributes2, Status>

Returns node attributes (io2).
Source§

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

Returns information about the filesystem and/or volume.
Source§

async fn list_extended_attributes(&self) -> Result<Vec<Vec<u8>>, Status>

List extended attributes.
Source§

async fn get_extended_attribute(&self, name: Vec<u8>) -> Result<Vec<u8>, Status>

Get the value for an extended attribute.
Source§

async fn set_extended_attribute( &self, name: Vec<u8>, value: Vec<u8>, mode: SetExtendedAttributeMode, ) -> Result<(), Status>

Set the value for an extended attribute.
Source§

async fn remove_extended_attribute(&self, name: Vec<u8>) -> Result<(), Status>

Remove the value for an extended attribute.
Source§

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

fn close(self: Arc<Self>)

Called when the node is closed.
Source§

fn open_as_node( self: Arc<Self>, scope: ExecutionScope, options: NodeOptions, object_request: &mut ObjectRequest, ) -> Result<(), Status>
where Self: Sized,

Opens the node using the node protocol.
Source§

impl RootDir for FxDirectory

Source§

fn as_directory_entry(self: Arc<Self>) -> Arc<dyn DirectoryEntry>

Source§

fn serve(self: Arc<Self>, flags: Flags, server_end: ServerEnd<DirectoryMarker>)

Source§

fn as_node(self: Arc<Self>) -> Arc<dyn FxNode>

Source§

fn register_additional_volume_services( self: Arc<Self>, _svc_dir: &Simple, ) -> Result<(), Error>

Source§

impl ToWeakNode for FxDirectory

Source§

fn to_weak_node(self: Arc<Self>) -> WeakNode

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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _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> InstanceFromServiceTransport<T> for T

§

fn from_service_transport(handle: T) -> T

Converts the given service transport handle of type T to [Self]
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.

Source§

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

Source§

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

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

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<E> RunsTransport<Mpsc> for E

§

impl<E> RunsTransport<Mpsc> for E
where E: RunsTransport<Mpsc>,