Derive Macro IntoRow

Source
#[derive(IntoRow)]
{
    // Attributes available to this derive:
    #[col]
}
Expand description

Derive macro to convert a struct to a row with move semantics.

§Example

use api::v1::Row;
use api::v1::value::ValueData;
use api::v1::Value;

#[derive(IntoRow)]
struct IntoRowTest {
    my_value: i32,
    #[col(name = "string_value", datatype = "string", semantic = "tag")]
    my_string: String,  
    my_bool: bool,
    my_float: f32,
    #[col(
        name = "timestamp_value",
        semantic = "Timestamp",
        datatype = "TimestampMillisecond"
    )]
    my_timestamp: i64,
    #[col(skip)]
    my_skip: i32,
}

let row = IntoRowTest {
    my_value: 1,
    my_string: "test".to_string(),
    my_bool: true,
    my_float: 1.0,
    my_timestamp: 1718563200000,
    my_skip: 1,
}.into_row();