DirNode

Struct DirNode 

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

Implementations§

Source§

impl DirNode

Source

pub fn new(ops: Arc<dyn DirNodeOps>) -> Self

Source

pub fn inner(&self) -> &Arc<dyn DirNodeOps>

Source

pub fn downcast<T: DirNodeOps>(&self) -> VfsResult<Arc<T>>

Source

pub fn lookup(&self, name: &str) -> VfsResult<DirEntry>

Looks up a directory entry by name.

Source

pub fn lookup_cache(&self, name: &str) -> Option<DirEntry>

Looks up a directory entry by name in cache.

Source

pub fn insert_cache(&self, name: String, entry: DirEntry) -> Option<DirEntry>

Inserts a directory entry into the cache.

Source

pub fn read_dir( &self, offset: u64, sink: &mut dyn DirEntrySink, ) -> VfsResult<usize>

Creates a link to a node.

Unlinks a directory entry by name.

Source

pub fn has_children(&self) -> VfsResult<bool>

Returns whether the directory contains children.

Source

pub fn create( &self, name: &str, node_type: NodeType, permission: NodePermission, ) -> VfsResult<DirEntry>

Creates a directory entry.

Source

pub fn rename( &self, src_name: &str, dst_dir: &Self, dst_name: &str, ) -> VfsResult<()>

Renames a directory entry.

Source

pub fn open_file( &self, name: &str, options: &OpenOptions, ) -> VfsResult<DirEntry>

Opens (or creates) a file in the directory.

Source

pub fn mountpoint(&self) -> Option<Arc<Mountpoint>>

Source

pub fn is_mountpoint(&self) -> bool

Trait Implementations§

Source§

impl Deref for DirNode

Source§

type Target = dyn NodeOps

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<DirNode> for Arc<dyn NodeOps>

Source§

fn from(node: DirNode) -> Self

Converts to this type from the input type.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.