Skip to main content

DataView

Trait DataView 

Source
pub trait DataView {
    // Required methods
    fn nrows(&self) -> usize;
    fn f64_col(&self, col: &Col<f64>) -> Result<NumericCol<'_>, FormulaError>;

    // Provided methods
    fn bool_col(&self, col: &Col<bool>) -> Result<BoolCol<'_>, FormulaError> { ... }
    fn cat_col(&self, col: &Col<Category>) -> Result<CatCol<'_>, FormulaError> { ... }
}
Expand description

Read-only data access contract for the formula layer.

Required Methods§

Source

fn nrows(&self) -> usize

Number of rows visible to the model builder.

Source

fn f64_col(&self, col: &Col<f64>) -> Result<NumericCol<'_>, FormulaError>

Returns an f64 column by typed column reference.

Implementations should return FormulaError::UnknownColumn when the name is not available. The formula layer validates row counts.

Provided Methods§

Source

fn bool_col(&self, col: &Col<bool>) -> Result<BoolCol<'_>, FormulaError>

Returns a bool column by typed column reference.

Source

fn cat_col(&self, col: &Col<Category>) -> Result<CatCol<'_>, FormulaError>

Returns a categorical column by typed column reference.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§