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>
pub fn check_path(&self, path: &Path) -> Result<PathBuf, Error>
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Checker
impl RefUnwindSafe for Checker
impl Send for Checker
impl Sync for Checker
impl Unpin for Checker
impl UnsafeUnpin for Checker
impl UnwindSafe for Checker
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