Struct root::RootDirectory
source · pub struct RootDirectory { /* private fields */ }
Expand description
A struct that represents a node in the VFS
Trait Implementations§
source§impl Directory for RootDirectory
impl Directory for RootDirectory
source§fn insert(&mut self, node: FileOrDir) -> Result<Option<FileOrDir>, &'static str>
fn insert(&mut self, node: FileOrDir) -> Result<Option<FileOrDir>, &'static str>
Inserts the given new file or directory into this directory.
If an existing node has the same name, that node is replaced and returned. Read more
source§fn get(&self, name: &str) -> Option<FileOrDir>
fn get(&self, name: &str) -> Option<FileOrDir>
Gets either the file or directory in this
Directory
on its name.source§fn remove(&mut self, node: &FileOrDir) -> Option<FileOrDir>
fn remove(&mut self, node: &FileOrDir) -> Option<FileOrDir>
Removes a file or directory from this directory and returns it if found.
Also, the returned node’s parent directory reference is cleared. Read more
source§impl FsNode for RootDirectory
impl FsNode for RootDirectory
source§fn get_absolute_path(&self) -> String
fn get_absolute_path(&self) -> String
Recursively gets the absolute pathname as a String
source§fn get_parent_dir(&self) -> Option<DirRef>
fn get_parent_dir(&self) -> Option<DirRef>
we just return the root itself because it is the top of the filesystem
source§fn set_parent_dir(&mut self, _: WeakDirRef)
fn set_parent_dir(&mut self, _: WeakDirRef)
Sets this node’s parent directory.
This is useful for ensuring correctness when inserting or removing
files or directories from their parent directory.
Auto Trait Implementations§
impl !RefUnwindSafe for RootDirectory
impl Send for RootDirectory
impl Sync for RootDirectory
impl Unpin for RootDirectory
impl !UnwindSafe for RootDirectory
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