pub trait MarkdownLinter {
// Required method
fn lint(&mut self, request: &LintRequest<'_>) -> Result<LintRun, String>;
}Expand description
What:
Whatever lints one candidate.
A trait is a named set of methods,
like a TS
interface;
&mut self lends it for writing,
because it may remember the program
and its configuration across candidates.
Why:
The executable starts the real linter;
tests answer from a script,
so every branch
of the policy is reached without a child process.
In TS you’d write (pseudocode):
interface MarkdownLinter { lint(request: LintRequest): LintRun } // throws stringRequired Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl MarkdownLinter for ProcessLinter
What:
impl MarkdownLinter for ProcessLinter starts the real linter for each request.
Why:
See the module comment.
In TS you’d write (pseudocode):
class ProcessLinter implements MarkdownLinter {}