StaticAnalyzer

Trait StaticAnalyzer 

Source
pub trait StaticAnalyzer<Config: StaticAnalyzerConfig> {
    // Required methods
    fn command(self) -> String;
    fn download(
        self,
        config: Option<Config>,
        skip_verify_checksum: bool,
    ) -> Self;
    fn download_checksums(self) -> Result<HashMap<String, String>, String>;
    fn extract(self, path: PathBuf, destination: Option<PathBuf>) -> PathBuf;
    fn resolve(
        _config: Config,
        _is_offline: bool,
        _skip_verify_checksum: bool,
    ) -> Self;
    fn run(&self, id: String, content: String, output: Option<String>) -> Check;
    fn sync(self, is_offline: bool) -> Result<(), Error>;
    fn with_binary<P>(self, path: P) -> Self
       where P: Into<PathBuf>;
    fn with_config(self, value: Config) -> Self;
    fn with_system_command(self) -> Self;
    fn with_version(self, value: String) -> Self;
}
Expand description

Trait for static analyzers (e.g. Vale)

Required Methods§

Source

fn command(self) -> String

Get command name (e.g. “vale”)

Source

fn download(self, config: Option<Config>, skip_verify_checksum: bool) -> Self

Download binary

Source

fn download_checksums(self) -> Result<HashMap<String, String>, String>

Download checksum values

Source

fn extract(self, path: PathBuf, destination: Option<PathBuf>) -> PathBuf

Extract binary

Source

fn resolve( _config: Config, _is_offline: bool, _skip_verify_checksum: bool, ) -> Self

Resolve analyzer

Source

fn run(&self, id: String, content: String, output: Option<String>) -> Check

Run analyzer on content

Source

fn sync(self, is_offline: bool) -> Result<(), Error>

Perform sync operation (only applies to Vale)

Source

fn with_binary<P>(self, path: P) -> Self
where P: Into<PathBuf>,

Set binary

Source

fn with_config(self, value: Config) -> Self

Set config

Source

fn with_system_command(self) -> Self

Set system command

Source

fn with_version(self, value: String) -> Self

Set version

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§