Skip to main content

Row

Trait Row 

Source
pub trait Row: Sized {
    const COLUMN_COUNT: Option<usize>;

    // Required methods
    fn column_names() -> Option<Vec<Cow<'static, str>>>;
    fn deserialize_row(map: Vec<(&str, &Type, Value)>) -> Result<Self>;
    fn serialize_row(
        self,
        type_hints: &IndexMap<String, Type>,
    ) -> Result<Vec<(Cow<'static, str>, Value)>>;
}
Expand description

A row that can be deserialized and serialized from a raw Clickhouse SQL value. Generally this is not implemented manually, but using nativeclick_derive::Row. I.e. #[derive(nativeclick::Row)].

Required Associated Constants§

Source

const COLUMN_COUNT: Option<usize>

If Some, serialize_row and deserialize_row MUST return this number of columns

Required Methods§

Source

fn column_names() -> Option<Vec<Cow<'static, str>>>

If Some, serialize_row and deserialize_row MUST have these names

Source

fn deserialize_row(map: Vec<(&str, &Type, Value)>) -> Result<Self>

Source

fn serialize_row( self, type_hints: &IndexMap<String, Type>, ) -> Result<Vec<(Cow<'static, str>, Value)>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Row for Migration

Source§

const COLUMN_COUNT: Option<usize>

Source§

fn column_names() -> Option<Vec<Cow<'static, str>>>

Source§

fn deserialize_row(map: Vec<(&str, &Type, Value)>) -> Result<Self>

Source§

fn serialize_row( self, _type_hints: &IndexMap<String, Type>, ) -> Result<Vec<(Cow<'static, str>, Value)>>

Implementors§