Skip to main content

Tools

Trait Tools 

Source
pub trait Tools {
    // Required methods
    fn check(&mut self) -> Result<String, String>;
    fn rules(&mut self) -> Result<String, String>;
    fn explain(&mut self, rule: &str) -> Result<String, String>;
}
Expand description

What the host can ask lanekeep to do.

A trait rather than an engine, for the same reason the LSP loop takes a closure: this crate stays protocol-only, and its tests need no project on disk.

Required Methods§

Source

fn check(&mut self) -> Result<String, String>

Run the project’s rules and describe what they found.

§Errors

Returns the message to show the model when the run could not happen at all.

Source

fn rules(&mut self) -> Result<String, String>

List the rules the project has configured.

§Errors

As Tools::check.

Source

fn explain(&mut self, rule: &str) -> Result<String, String>

Explain one rule: what it checks and what to do about it.

§Errors

As Tools::check, including when no such rule is configured.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§