Trait polars_core::schema::IndexOfSchema

source ·
pub trait IndexOfSchema: Debug {
    // Required methods
    fn index_of(&self, name: &str) -> Option<usize>;
    fn get_names(&self) -> Vec<&str>;

    // Provided method
    fn try_index_of(&self, name: &str) -> PolarsResult<usize> { ... }
Expand description

This trait exists to be unify the API of polars Schema and arrows Schema

Required Methods§


fn index_of(&self, name: &str) -> Option<usize>

Get the index of a column by name.


fn get_names(&self) -> Vec<&str>

Get a vector of all column names.

Provided Methods§