Validator

Trait Validator 

Source
pub trait Validator: Send + Sync {
    // Required methods
    fn validate(&self, kind: &SlotKind, code: &str) -> Result<ValidationResult>;
    fn format(&self, kind: &SlotKind, code: &str) -> Result<String>;
}
Expand description

Trait for implementing code validators and formatters.

Required Methods§

Source

fn validate(&self, kind: &SlotKind, code: &str) -> Result<ValidationResult>

Check if the code is valid according to the validator’s rules.

Source

fn format(&self, kind: &SlotKind, code: &str) -> Result<String>

Format the code to comply with style guides.

Implementors§