pub trait FileDirEntry {
// Required methods
fn entry_type(&self) -> &FileDirTypes;
fn name(&self) -> &str;
fn timestamp(&self) -> &str;
fn length(&mut self) -> i32;
fn children(&self) -> Option<&Vec<Rc<RefCell<dyn FileDirEntry>>>>;
}
Expand description
Represents an entry in a hierarchical list of objects composed of files and directories, where the directories can contain nested files and directories. This is a trait as it is the only way to represent a polymorphic concept like the composite design pattern where all the entries look the same to the rest of the program.
Required Methods§
sourcefn entry_type(&self) -> &FileDirTypes
fn entry_type(&self) -> &FileDirTypes
Returns a reference to the FileDirTypes value representing the type of entry this trait represents.