pub struct Checker { /* private fields */ }Expand description
Shared context for resolving input and output files paths post deserialization.
Implementations§
Source§impl Checker
impl Checker
Sourcepub fn search_directories(&self) -> &[PathBuf]
pub fn search_directories(&self) -> &[PathBuf]
Return the ordered list of search directories registered with the Checker.
Sourcepub fn output_directory(&self) -> Option<&PathBuf>
pub fn output_directory(&self) -> Option<&PathBuf>
Return the output directory registered with the Checker, if any.
Sourcepub fn register_output(&mut self, save_path: Option<&Path>) -> Result<PathBuf>
pub fn register_output(&mut self, save_path: Option<&Path>) -> Result<PathBuf>
Register save_path as an output directory and resolve save_path to an absolute path.
§NOTE
The behavior of this function is expected to change in the near future.
Sourcepub fn check_path(&self, path: &Path) -> Result<PathBuf, Error>
👎Deprecated since 0.54.0: please use find_input_file instead
pub fn check_path(&self, path: &Path) -> Result<PathBuf, Error>
please use find_input_file instead
Try to resolve path using the following approach:
-
If
pathis absolute - check that it exists and is a valid file. If successful, returnpathunaltered. -
If
pathis relative, work throughself.search_directories()in order, returning the absolute path first existing file.
Sourcepub fn find_input_file(&self, path: &Path) -> Result<PathBuf, Error>
pub fn find_input_file(&self, path: &Path) -> Result<PathBuf, Error>
Try to resolve path as a file using the following approach:
-
If
pathis absolute - check that it exists and is a valid file. If successful, returnpathunaltered. -
If
pathis relative, work throughself.search_directories()in order, returning the absolute path first existing file.
See also: Self::find_input_dir.
Sourcepub fn find_input_dir(&self, path: &Path) -> Result<PathBuf, Error>
pub fn find_input_dir(&self, path: &Path) -> Result<PathBuf, Error>
Try to resolve path as a directory using the following approach:
-
If
pathis absolute - check that it exists and is a valid directory. If successful, returnpathunaltered. -
If
pathis relative, work throughself.search_directories()in order, returning the absolute path first existing directory.
See also: Self::find_input_file.