pub struct Project {
pub root: PathBuf,
pub main: (FileName, TreeName),
pub files: HashMap<FileName, File>,
pub std: HashSet<ActionName>,
}Expand description
the base structure represents the folder on the disk with some auxiliary info
§Structure
rootis a root of the project. Every import relates to it.mainis a pointer to the file and definition when the tree is started.filesis a map of the filesstdis a set of the standard actions
Fields§
§root: PathBuf§main: (FileName, TreeName)§files: HashMap<FileName, File>§std: HashSet<ActionName>Implementations§
Source§impl<'a> Project
impl<'a> Project
pub fn find_file(&'a self, f_name: &str) -> Result<&'a File, TreeError>
pub fn find_root( &'a self, name: &TreeName, file: &FileName, ) -> Result<&'a Tree, TreeError>
pub fn find_tree(&self, file: &FileName, tree: &TreeName) -> Option<&Tree>
Sourcepub fn build_with_root(
main_file: FileName,
main_call: TreeName,
root: PathBuf,
) -> Result<Project, TreeError>
pub fn build_with_root( main_file: FileName, main_call: TreeName, root: PathBuf, ) -> Result<Project, TreeError>
build the project with the given root and main file
Suppose we have the following structure:
- root_folder
- folder
- main.tree # root tree_name
- other.tree
- folder
Setting up the root as root_folder allows pulling in the other.tree file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Project
impl RefUnwindSafe for Project
impl Send for Project
impl Sync for Project
impl Unpin for Project
impl UnwindSafe for Project
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more