diff --git a/crates/store/re_chunk_store/src/dataframe.rs b/crates/store/re_chunk_store/src/dataframe.rs index a71c3db5508b..0a4b01e8f19d 100644 --- a/crates/store/re_chunk_store/src/dataframe.rs +++ b/crates/store/re_chunk_store/src/dataframe.rs @@ -411,6 +411,7 @@ pub enum ColumnSelector { } impl From for ColumnSelector { + #[inline] fn from(desc: ColumnDescriptor) -> Self { match desc { ColumnDescriptor::Control(desc) => Self::Control(desc.into()), @@ -421,18 +422,21 @@ impl From for ColumnSelector { } impl From for ColumnSelector { + #[inline] fn from(desc: ControlColumnSelector) -> Self { Self::Control(desc) } } impl From for ColumnSelector { + #[inline] fn from(desc: TimeColumnSelector) -> Self { Self::Time(desc) } } impl From for ColumnSelector { + #[inline] fn from(desc: ComponentColumnSelector) -> Self { Self::Component(desc) } @@ -447,7 +451,17 @@ pub struct ControlColumnSelector { pub component: ComponentName, } +impl ControlColumnSelector { + #[inline] + pub fn row_id() -> Self { + Self { + component: RowId::name(), + } + } +} + impl From for ControlColumnSelector { + #[inline] fn from(desc: ControlColumnDescriptor) -> Self { Self { component: desc.component_name, @@ -463,9 +477,10 @@ pub struct TimeColumnSelector { } impl From for TimeColumnSelector { + #[inline] fn from(desc: TimeColumnDescriptor) -> Self { Self { - timeline: desc.timeline.name().clone(), + timeline: *desc.timeline.name(), } } } @@ -489,6 +504,7 @@ pub struct ComponentColumnSelector { } impl From for ComponentColumnSelector { + #[inline] fn from(desc: ComponentColumnDescriptor) -> Self { Self { entity_path: desc.entity_path.clone(), @@ -499,6 +515,8 @@ impl From for ComponentColumnSelector { } impl ComponentColumnSelector { + /// Select a component of a given type, based on its [`EntityPath`] + #[inline] pub fn new(entity_path: EntityPath) -> Self { Self { entity_path, @@ -507,6 +525,16 @@ impl ComponentColumnSelector { } } + /// Select a component based on its [`EntityPath`] and [`ComponentName`]. + #[inline] + pub fn new_for_component_name(entity_path: EntityPath, component: ComponentName) -> Self { + Self { + entity_path, + component, + join_encoding: JoinEncoding::default(), + } + } + /// Specify how the data should be joined into the `RecordBatch`. #[inline] pub fn with_join_encoding(mut self, join_encoding: JoinEncoding) -> Self {