Skip to main content

define_columns

Macro define_columns 

Source
macro_rules! define_columns {
    (
        $(#[$meta:meta])*
        $vis:vis $name:ident {
            $( $field:ident : $kind:tt ),* $(,)?
        }
    ) => { ... };
    (@consts $offset:expr;) => { ... };
    (@consts $offset:expr; $field:ident : [$ty:ident; $n:expr], $( $rest:tt )*) => { ... };
    (@consts $offset:expr; $field:ident : $ty:ident, $( $rest:tt )*) => { ... };
    (@push $v:ident, $ty:ident) => { ... };
    (@push $v:ident, [$ty:ident; $n:expr]) => { ... };
}
Expand description

Define a typed column schema.

Generates index constants, NUM_COLUMNS, and build_layout() -> Vec<ColumnType>.