Trait fs_node::FsNode

source ·
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§

source

fn get_name(&self) -> String

Returns the string name of the node

source

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)

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§

source

fn get_absolute_path(&self) -> String

Recursively gets the absolute pathname as a String

Implementors§