Skip to main content

TableView

Trait TableView 

Source
pub trait TableView {
    // Required methods
    fn schema(&self) -> &CausalSchema;
    fn row_count(&self) -> usize;
    fn column(&self, id: VariableId) -> Result<ColumnView<'_>, DataError>;

    // Provided method
    fn float64_values(&self, id: VariableId) -> Result<Vec<f64>, DataError> { ... }
}
Expand description

Borrowed table access used by algorithms.

Required Methods§

Source

fn schema(&self) -> &CausalSchema

Immutable causal schema.

Source

fn row_count(&self) -> usize

Number of rows.

Source

fn column(&self, id: VariableId) -> Result<ColumnView<'_>, DataError>

Column view for id.

§Errors

Unknown variable or type issues.

Provided Methods§

Source

fn float64_values(&self, id: VariableId) -> Result<Vec<f64>, DataError>

Copy a column into an owned f64 buffer.

Native Float64 columns are copied as-is. Int64 and Boolean columns are coerced to f64 (true1.0, false0.0); invalid rows become NaN. Other column kinds (categorical, timestamp, fixed vector) error.

§Errors

Unknown variable or unsupported column type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§