Skip to main content

Record

Derive Macro Record 

Source
#[derive(Record)]
{
    // Attributes available to this derive:
    #[event_time]
    #[column]
    #[nullable]
}
Expand description

Derive the Record trait for a struct.

Generates Record::schema(), Record::to_record_batch(), and Record::event_time() implementations automatically.

§Supported Field Types

Rust TypeArrow DataType
boolBoolean
i8Int8
i16Int16
i32Int32
i64Int64
u8UInt8
u16UInt16
u32UInt32
u64UInt64
f32Float32
f64Float64
StringUtf8
Vec<u8>Binary
Option<T>nullable variant of T

§Attributes

  • #[event_time] — marks a field as the event time column
  • #[column("name")] — overrides the Arrow column name
  • #[nullable] — marks a non-Option field as nullable in the schema