Skip to main content

Validator

Trait Validator 

Source
pub trait Validator: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn supports(&self, language: Language) -> bool;
    fn validate_parsed(
        &self,
        code: &ParsedCode,
        file: &Path,
    ) -> Result<ValidationResult>;

    // Provided method
    fn validate_raw(
        &self,
        source: &str,
        file: &Path,
    ) -> Result<ValidationResult> { ... }
}
Expand description

Validator trait

Required Methods§

Source

fn name(&self) -> &str

Get validator name

Source

fn supports(&self, language: Language) -> bool

Check if validator supports given language

Source

fn validate_parsed( &self, code: &ParsedCode, file: &Path, ) -> Result<ValidationResult>

Validate parsed code

Provided Methods§

Source

fn validate_raw(&self, source: &str, file: &Path) -> Result<ValidationResult>

Validate raw source (fallback)

Implementors§