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 any<T>(&mut self, value: T) -> Result<Any>
pub fn any<T>(&mut self, value: T) -> Result<Any>
Invoke CheckDeserialization on value and if successful, package it in Any.
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
Source§impl<T> DispatchRule<T> for T
impl<T> DispatchRule<T> for T
Source§type Error = Infallible
type Error = Infallible
Errors that can occur during
convert.Source§fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
fn try_match(_from: &T) -> Result<MatchScore, FailureScore>
Source§fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
fn convert(from: T) -> Result<T, <T as DispatchRule<T>>::Error>
Perform the actual conversion. Read more
Source§fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
fn description(f: &mut Formatter<'_>, from: Option<&T>) -> Result<(), Error>
Write a description of the dispatch rule and outcome to the formatter. Read more
Source§fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
fn try_match_verbose<'a>(
from: &'a From,
) -> Result<MatchScore, TaggedFailureScore<'a>>where
Self: 'a,
The equivalent of
try_match but returns a reason for a failed score. Read more