pub struct FileHierarchy { /* private fields */ }
Expand description
File hierarchy definition, handles file path generation.
Implementations§
Source§impl FileHierarchy
impl FileHierarchy
Sourcepub fn mountpoint(&self) -> PathBuf
pub fn mountpoint(&self) -> PathBuf
Returns the directory where the file hierarchy is mounted.
Sourcepub fn folder<COMP: Component>(&self, component: &COMP) -> PathBuf
pub fn folder<COMP: Component>(&self, component: &COMP) -> PathBuf
Generates the folder path according to the file hierarchy. The folder
that contains the file_type
always corresponds to the extension of the
files contained.
Sourcepub fn get_file_list<COMP: Component>(
&self,
component: &COMP,
) -> Result<Vec<PathBuf>, LewpError>
pub fn get_file_list<COMP: Component>( &self, component: &COMP, ) -> Result<Vec<PathBuf>, LewpError>
Collects all filenames in the given component. The resulting vector contains the filepath including the mountpoint of the FileHierarchy. This function is not recursive.
Sourcepub fn collect_component_ids(
&self,
kind: ComponentType,
level: Level,
) -> Result<Vec<String>, LewpError>
pub fn collect_component_ids( &self, kind: ComponentType, level: Level, ) -> Result<Vec<String>, LewpError>
Collects all filenames in the given directory.
The directory is relative to the mountpoint of the file hierarchy. Gets a list of the component ids available for this ComponentType on the given Level.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileHierarchy
impl RefUnwindSafe for FileHierarchy
impl Send for FileHierarchy
impl Sync for FileHierarchy
impl Unpin for FileHierarchy
impl UnwindSafe for FileHierarchy
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