pub trait TableRule:
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 table-level aggregate rules
Required Methods§
Sourcefn new_column_name(&self, column_name: &str) -> String
fn new_column_name(&self, column_name: &str) -> String
Get the name of the new column
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Get the description of the rule
Provided Methods§
Sourcefn apply(
&self,
_df: DataFrame,
_column_name: &str,
) -> Result<DataFrame, ValidationError>
fn apply( &self, _df: DataFrame, _column_name: &str, ) -> Result<DataFrame, ValidationError>
Apply the rule to a DataFrame, adding a new column with aggregated results
Sourcefn apply_with_ruleset(
&self,
df: DataFrame,
column_name: &str,
_rule_set: &RuleSet,
) -> Result<DataFrame, ValidationError>
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".