ChRecord

Trait ChRecord 

Source
pub trait ChRecord: Sized {
    // Required methods
    fn ch_schema() -> TableSchema;
    fn into_ch_record(self) -> Record;
    fn from_ch_record(record: Record) -> Result<Self, Error>;

    // Provided methods
    fn to_query_data(records: Vec<Self>) -> QueryData { ... }
    fn from_query_data(data: QueryData) -> Result<Vec<Self>, Error> { ... }
}
Expand description

A trait to convert from/to a Clickhouse Record

Required Methods§

Source

fn ch_schema() -> TableSchema

Returns the Clickhouse schema

Source

fn into_ch_record(self) -> Record

Converts to a Record

Source

fn from_ch_record(record: Record) -> Result<Self, Error>

Converts from a Record

Provided Methods§

Source

fn to_query_data(records: Vec<Self>) -> QueryData

Converts records to a [QueryTable]

Source

fn from_query_data(data: QueryData) -> Result<Vec<Self>, Error>

Parses multiple records from a [QueryTable]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§