pub trait FsNode {
// Required methods
fn get_name(&self) -> String;
fn get_parent_dir(&self) -> Option<DirRef>;
fn set_parent_dir(&mut self, new_parent: WeakDirRef);
// Provided method
fn get_absolute_path(&self) -> String { ... }
}
Expand description
A trait that covers any filesystem node, both files and directories.
Required Methods§
sourcefn get_parent_dir(&self) -> Option<DirRef>
fn get_parent_dir(&self) -> Option<DirRef>
Returns the parent directory of the current node.
sourcefn 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.
Provided Methods§
sourcefn get_absolute_path(&self) -> String
fn get_absolute_path(&self) -> String
Recursively gets the absolute pathname as a String