Trait kailua_check::options::FsSource
[−]
[src]
pub trait FsSource { fn chunk_from_path(
&self,
resolved_path: Spanned<&Path>,
report: &Report
) -> Result<Option<Chunk>, Option<Stop>>; fn to_path_buf(
&self,
path: Spanned<&[u8]>,
_report: &Report
) -> Result<PathBuf, Option<Stop>> { ... } }
Checker options that are tailored to loading from the file system.
Follows the same error conventions as Options
.
Required Methods
fn chunk_from_path(
&self,
resolved_path: Spanned<&Path>,
report: &Report
) -> Result<Option<Chunk>, Option<Stop>>
&self,
resolved_path: Spanned<&Path>,
report: &Report
) -> Result<Option<Chunk>, Option<Stop>>
Should try to load a given fully resolved path and return a chunk or None
.
None
here means that the path doesn't exist and the search should continue.
Other error cases can be reported as Err(..)
as with Options
.
Provided Methods
fn to_path_buf(
&self,
path: Spanned<&[u8]>,
_report: &Report
) -> Result<PathBuf, Option<Stop>>
&self,
path: Spanned<&[u8]>,
_report: &Report
) -> Result<PathBuf, Option<Stop>>
Should try to parse a byte string containing a relative path to a path buffer.
Used to delegate the encoding decision to the user. This will only parse ASCII paths by default, in order to avoid the confusion.