Trait bookdata::arrow::row::ColType

source ·
pub trait ColType: Sized {
    type PolarsType;
    type Array;
    type Builder;

    // Required methods
    fn column_builder(name: &str, cap: usize) -> Self::Builder;
    fn append_to_column(self, b: &mut Self::Builder);
    fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>;
    fn read_from_column(
        name: &'static str,
        a: &Self::Array,
        pos: usize
    ) -> Result<Self, RowError>;
}
Expand description

Trait for column types.

Required Associated Types§

Required Methods§

source

fn column_builder(name: &str, cap: usize) -> Self::Builder

Create a new builder.

source

fn append_to_column(self, b: &mut Self::Builder)

Append this item to a builder.

source

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

Cast a series to the appropriate chunked type.

source

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

Read a value from an array.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ColType for Option<bool>

§

type PolarsType = BooleanType

§

type Array = ChunkedArray<BooleanType>

§

type Builder = BooleanChunkedBuilder

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<f32>

§

type PolarsType = Float32Type

§

type Array = ChunkedArray<Float32Type>

§

type Builder = PrimitiveChunkedBuilder<Float32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<f64>

§

type PolarsType = Float64Type

§

type Array = ChunkedArray<Float64Type>

§

type Builder = PrimitiveChunkedBuilder<Float64Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<i8>

§

type PolarsType = Int8Type

§

type Array = ChunkedArray<Int8Type>

§

type Builder = PrimitiveChunkedBuilder<Int8Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<i16>

§

type PolarsType = Int16Type

§

type Array = ChunkedArray<Int16Type>

§

type Builder = PrimitiveChunkedBuilder<Int16Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<i32>

§

type PolarsType = Int32Type

§

type Array = ChunkedArray<Int32Type>

§

type Builder = PrimitiveChunkedBuilder<Int32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<i64>

§

type PolarsType = Int64Type

§

type Array = ChunkedArray<Int64Type>

§

type Builder = PrimitiveChunkedBuilder<Int64Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<u8>

§

type PolarsType = UInt8Type

§

type Array = ChunkedArray<UInt8Type>

§

type Builder = PrimitiveChunkedBuilder<UInt8Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<u16>

§

type PolarsType = UInt16Type

§

type Array = ChunkedArray<UInt16Type>

§

type Builder = PrimitiveChunkedBuilder<UInt16Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<u32>

§

type PolarsType = UInt32Type

§

type Array = ChunkedArray<UInt32Type>

§

type Builder = PrimitiveChunkedBuilder<UInt32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<u64>

§

type PolarsType = UInt64Type

§

type Array = ChunkedArray<UInt64Type>

§

type Builder = PrimitiveChunkedBuilder<UInt64Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<String>

§

type PolarsType = StringType

§

type Array = ChunkedArray<StringType>

§

type Builder = BinViewChunkedBuilder<str>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for Option<NaiveDate>

§

type PolarsType = DateType

§

type Array = Logical<DateType, Int32Type>

§

type Builder = PrimitiveChunkedBuilder<Int32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( _name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for bool

§

type PolarsType = BooleanType

§

type Array = ChunkedArray<BooleanType>

§

type Builder = BooleanChunkedBuilder

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for f32

§

type PolarsType = Float32Type

§

type Array = ChunkedArray<Float32Type>

§

type Builder = PrimitiveChunkedBuilder<Float32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for f64

§

type PolarsType = Float64Type

§

type Array = ChunkedArray<Float64Type>

§

type Builder = PrimitiveChunkedBuilder<Float64Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for i8

§

type PolarsType = Int8Type

§

type Array = ChunkedArray<Int8Type>

§

type Builder = PrimitiveChunkedBuilder<Int8Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for i16

§

type PolarsType = Int16Type

§

type Array = ChunkedArray<Int16Type>

§

type Builder = PrimitiveChunkedBuilder<Int16Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for i32

§

type PolarsType = Int32Type

§

type Array = ChunkedArray<Int32Type>

§

type Builder = PrimitiveChunkedBuilder<Int32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for i64

§

type PolarsType = Int64Type

§

type Array = ChunkedArray<Int64Type>

§

type Builder = PrimitiveChunkedBuilder<Int64Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for u8

§

type PolarsType = UInt8Type

§

type Array = ChunkedArray<UInt8Type>

§

type Builder = PrimitiveChunkedBuilder<UInt8Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for u16

§

type PolarsType = UInt16Type

§

type Array = ChunkedArray<UInt16Type>

§

type Builder = PrimitiveChunkedBuilder<UInt16Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for u32

§

type PolarsType = UInt32Type

§

type Array = ChunkedArray<UInt32Type>

§

type Builder = PrimitiveChunkedBuilder<UInt32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for u64

§

type PolarsType = UInt64Type

§

type Array = ChunkedArray<UInt64Type>

§

type Builder = PrimitiveChunkedBuilder<UInt64Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for String

§

type PolarsType = StringType

§

type Array = ChunkedArray<StringType>

§

type Builder = BinViewChunkedBuilder<str>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

source§

impl ColType for NaiveDate

§

type PolarsType = DateType

§

type Array = Logical<DateType, Int32Type>

§

type Builder = PrimitiveChunkedBuilder<Int32Type>

source§

fn column_builder(name: &str, cap: usize) -> Self::Builder

source§

fn append_to_column(self, b: &mut Self::Builder)

source§

fn cast_series<'a>(s: &'a Series) -> PolarsResult<&'a Self::Array>

source§

fn read_from_column( name: &'static str, a: &Self::Array, pos: usize ) -> Result<Self, RowError>

Implementors§