Skip to main content

ColumnRule

Trait ColumnRule 

Source
pub trait ColumnRule:
    Send
    + Sync
    + Debug {
    // Required methods
    fn name(&self) -> &str;
    fn new_column_name(&self, column_name: &str) -> String;
    fn description(&self) -> &str;

    // Provided methods
    fn apply(
        &self,
        _df: DataFrame,
        _column_name: &str,
    ) -> Result<DataFrame, ValidationError> { ... }
    fn apply_with_ruleset(
        &self,
        df: DataFrame,
        column_name: &str,
        _rule_set: &RuleSet,
    ) -> Result<DataFrame, ValidationError> { ... }
}
Expand description

Trait for column-level rules

Required Methods§

Source

fn name(&self) -> &str

Get the name of the rule

Source

fn new_column_name(&self, column_name: &str) -> String

Get the name of the new column

Source

fn description(&self) -> &str

Get the description of the rule

Provided Methods§

Source

fn apply( &self, _df: DataFrame, _column_name: &str, ) -> Result<DataFrame, ValidationError>

Apply the rule to a DataFrame, adding a new column

Source

fn apply_with_ruleset( &self, df: DataFrame, column_name: &str, _rule_set: &RuleSet, ) -> Result<DataFrame, ValidationError>

Apply the rule to a DataFrame with access to the RuleSet

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§