Trait RoleValidator

Source
pub trait RoleValidator: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn validate(&self, role: &ParsedRole) -> RoleValidationResult;
    fn requires_target(&self) -> bool;
    fn allows_display_text(&self) -> bool;

    // Provided method
    fn get_suggestions(&self, role: &ParsedRole) -> Vec<String> { ... }
}
Expand description

Trait for implementing role validators

Required Methods§

Source

fn name(&self) -> &str

Returns the name of the role this validator handles

Source

fn validate(&self, role: &ParsedRole) -> RoleValidationResult

Validates a parsed role

Source

fn requires_target(&self) -> bool

Returns whether this role requires a target

Source

fn allows_display_text(&self) -> bool

Returns whether this role allows display text

Provided Methods§

Source

fn get_suggestions(&self, role: &ParsedRole) -> Vec<String>

Provides suggestions for fixing role issues

Implementors§