pub struct IncludePathsBuilder { /* private fields */ }
Implementations§
Source§impl IncludePathsBuilder
impl IncludePathsBuilder
Sourcepub fn include_known(&mut self, path: &str) -> &mut Self
pub fn include_known(&mut self, path: &str) -> &mut Self
Add another include directory that we know the path to seek into
The directories are considered to be absolute if starting with /
or relative to current folder otherwise
You can chain multiple calls
Sourcepub fn include_exe_dir(&mut self) -> &mut Self
pub fn include_exe_dir(&mut self) -> &mut Self
Add current executable directory to seek into You can chain multiple calls
Sourcepub fn include_unknown(&mut self, path: &str) -> &mut Self
pub fn include_unknown(&mut self, path: &str) -> &mut Self
Add another include directory that we do not know the path to, to seek into
We will start seeking the directory first by backtracing from the the current folder until we reach the $HOME directory.
Once we find the directory, then we will check inside for the files.
Useful for testing inside project data.
For example cargo test
will execute from the ./target
folder and you have your test data inside a config
folder somewhere in your project.
The same fodler will be deployed in a subfolder next to the binary in deployment.
You can use this function to include the config
folder as unknown and the code will discover the directory by itself.
This feature is useful to avoid having multiple includes with ../..
etc to cover all scenarios.
You can chain multiple calls