Skip to main content

MarkdownLinter

Trait MarkdownLinter 

Source
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 string

Required Methods§

Source

fn lint(&mut self, request: &LintRequest<'_>) -> Result<LintRun, String>

Lint one candidate: the usable run, or why there is none, for the person.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

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 {}