Trait mz_persist_types::columnar::Data

source ·
pub trait Data: Debug + Send + Sync + Sized + 'static {
    type Cfg: ColumnCfg<Self>;
    type Ref<'a>: Default
       where Self: 'a;
    type Col: ColumnGet<Self> + From<Self::Mut>;
    type Mut: ColumnPush<Self>;
    type Stats: ColumnStats<Self> + StatsFrom<Self::Col>;
}
Expand description

A type understood by persist.

The equality and sorting of the encoded column matches those of this rust type.

This trait is implemented for owned types. However, for efficiency the columns themselves don’t store the owned types, so instead we read and write in terms of the associated Self::Ref. This is not simply &Self because e.g. it’s sometimes not possible for us to present the column as something like &Option<T> but we can always produce a Option<&T>. Tuples have a similar restriction.

This trait is intentionally “sealed” via the unexported Column trait.

There is a 1:1 mapping between implementors of Data and variants of the DataType enum. The parallel hierarchy exists so that Data can be ergonomic while DataType is object-safe and has exhaustiveness checking. A Data impl can be mapped to its corresponding DataType via ColumnCfg::as_type and back via DataType::data_fn.

Required Associated Types§

source

type Cfg: ColumnCfg<Self>

If necessary, whatever information beyond the type of Self needed to produce a columnar schema for this type.

Conceptually: type of Self + this config => columnar schema.

For most Data impls, this is not necessary and set to ().

source

type Ref<'a>: Default where Self: 'a

The associated reference type of Self used for reads and writes on columns of this type.

source

type Col: ColumnGet<Self> + From<Self::Mut>

The shared reference of columns of this type of data.

source

type Mut: ColumnPush<Self>

The exclusive builder of columns of this type of data.

source

type Stats: ColumnStats<Self> + StatsFrom<Self::Col>

The statistics type of columns of this type of data.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Data for Option<bool>

source§

impl Data for Option<f32>

source§

impl Data for Option<f64>

source§

impl Data for Option<i8>

source§

impl Data for Option<i16>

source§

impl Data for Option<i32>

source§

impl Data for Option<i64>

source§

impl Data for Option<u8>

source§

impl Data for Option<u16>

source§

impl Data for Option<u32>

source§

impl Data for Option<u64>

source§

impl Data for Option<DynStruct>

source§

impl Data for Option<String>

source§

impl Data for Option<Vec<u8>>

source§

impl Data for Option<OpaqueData>

source§

impl Data for bool

source§

impl Data for f32

§

type Cfg = ()

§

type Ref<'a> = f32

§

type Col = Buffer<f32>

§

type Mut = Vec<f32>

§

type Stats = PrimitiveStats<f32>

source§

impl Data for f64

§

type Cfg = ()

§

type Ref<'a> = f64

§

type Col = Buffer<f64>

§

type Mut = Vec<f64>

§

type Stats = PrimitiveStats<f64>

source§

impl Data for i8

§

type Cfg = ()

§

type Ref<'a> = i8

§

type Col = Buffer<i8>

§

type Mut = Vec<i8>

§

type Stats = PrimitiveStats<i8>

source§

impl Data for i16

§

type Cfg = ()

§

type Ref<'a> = i16

§

type Col = Buffer<i16>

§

type Mut = Vec<i16>

§

type Stats = PrimitiveStats<i16>

source§

impl Data for i32

§

type Cfg = ()

§

type Ref<'a> = i32

§

type Col = Buffer<i32>

§

type Mut = Vec<i32>

§

type Stats = PrimitiveStats<i32>

source§

impl Data for i64

§

type Cfg = ()

§

type Ref<'a> = i64

§

type Col = Buffer<i64>

§

type Mut = Vec<i64>

§

type Stats = PrimitiveStats<i64>

source§

impl Data for u8

§

type Cfg = ()

§

type Ref<'a> = u8

§

type Col = Buffer<u8>

§

type Mut = Vec<u8>

§

type Stats = PrimitiveStats<u8>

source§

impl Data for u16

§

type Cfg = ()

§

type Ref<'a> = u16

§

type Col = Buffer<u16>

§

type Mut = Vec<u16>

§

type Stats = PrimitiveStats<u16>

source§

impl Data for u32

§

type Cfg = ()

§

type Ref<'a> = u32

§

type Col = Buffer<u32>

§

type Mut = Vec<u32>

§

type Stats = PrimitiveStats<u32>

source§

impl Data for u64

§

type Cfg = ()

§

type Ref<'a> = u64

§

type Col = Buffer<u64>

§

type Mut = Vec<u64>

§

type Stats = PrimitiveStats<u64>

source§

impl Data for String

source§

impl Data for Vec<u8>

§

type Cfg = ()

§

type Ref<'a> = &'a [u8]

§

type Col = BinaryArray<i32>

§

type Mut = MutableBinaryArray<i32>

§

type Stats = BytesStats

Implementors§