pub enum FileOrDir {
File(FileRef),
Dir(DirRef),
}
Expand description
Allows us to return a generic type that can be matched by the caller to extract the underlying type
Variants§
Implementations§
Trait Implementations§
source§impl FsNode for FileOrDir
impl FsNode for FileOrDir
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>
Returns the parent directory of the current node.
source§fn set_parent_dir(&mut self, new_parent: WeakDirRef)
fn set_parent_dir(&mut self, new_parent: 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 FileOrDir
impl Send for FileOrDir
impl Sync for FileOrDir
impl Unpin for FileOrDir
impl !UnwindSafe for FileOrDir
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