ValidationRule

Trait ValidationRule 

Source
pub trait ValidationRule: Send + Sync {
    // Required methods
    fn rule_id(&self) -> &str;
    fn description(&self) -> &str;
    fn validate_config<'life0, 'life1, 'async_trait>(
        &'life0 self,
        config: &'life1 Config,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_credentials<'life0, 'life1, 'async_trait>(
        &'life0 self,
        credentials: &'life1 Credentials,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn applies_to(&self, _config: &Config) -> bool { ... }
}
Expand description

Individual validation rule

Required Methods§

Source

fn rule_id(&self) -> &str

Get rule identifier

Source

fn description(&self) -> &str

Get rule description

Source

fn validate_config<'life0, 'life1, 'async_trait>( &'life0 self, config: &'life1 Config, ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate configuration

Source

fn validate_credentials<'life0, 'life1, 'async_trait>( &'life0 self, credentials: &'life1 Credentials, ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate credentials

Provided Methods§

Source

fn applies_to(&self, _config: &Config) -> bool

Check if rule applies to config

Implementors§