You should be able to do this:
#[derive(ArrowField)]
#[arrow_field(name = "rerun.tuid")]
pub struct Tuid {
/// Approximate nanoseconds since epoch.
time_ns: u64,
/// Initialized to something random on each thread,
/// then incremented for each new [`Tuid`] being allocated.
inc: u64,
}
in order to yield this:
impl arrow2_convert::field::ArrowField for Tuid {
type Type = Self;
fn data_type() -> arrow2::datatypes::DataType {
let datatype = arrow2::datatypes::DataType::Struct(<[_]>::into_vec(Box::new([
<u64 as arrow2_convert::field::ArrowField>::field("time_ns"),
<u64 as arrow2_convert::field::ArrowField>::field("inc"),
])));
DataType::Extension("rerun.tuid".into(), Box::new(datatype), None)
}
}
Similarly, the Component trait should always generate extension types, automatically injecting the component name into the ArrowField definition (related to #1696).
This is not just about dev experience, this opens many doors in terms of data inspection.
You should be able to do this:
in order to yield this:
Similarly, the
Componenttrait should always generate extension types, automatically injecting the component name into theArrowFielddefinition (related to #1696).This is not just about dev experience, this opens many doors in terms of data inspection.