polars_rows_iter/
from_dataframe_row.rs

1use std::collections::HashMap;
2
3use polars::prelude::*;
4
5pub trait ColumnNameBuilder {
6    fn build(self) -> HashMap<&'static str, String>;
7}
8
9pub trait FromDataFrameRow<'a> {
10    type Builder: ColumnNameBuilder;
11    fn from_dataframe(
12        dataframe: &'a DataFrame,
13        columns: HashMap<&'static str, String>,
14    ) -> PolarsResult<Box<dyn Iterator<Item = PolarsResult<Self>> + 'a>>
15    where
16        Self: Sized;
17
18    fn create_builder() -> Self::Builder;
19}