diff --git a/crates/build/re_types_builder/src/codegen/rust/api.rs b/crates/build/re_types_builder/src/codegen/rust/api.rs index 895ae62da1148..2fc8460a48e3e 100644 --- a/crates/build/re_types_builder/src/codegen/rust/api.rs +++ b/crates/build/re_types_builder/src/codegen/rust/api.rs @@ -1216,8 +1216,8 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { let all_deserializers = { obj.fields.iter().map(|obj_field| { let obj_field_fqname = obj_field.fqname.as_str(); - let field_typ_fqname_str = obj_field.typ.fqname().unwrap(); let field_name = format_ident!("{}", obj_field.name); + let descr_fn_name = format_ident!("descriptor_{field_name}"); let is_plural = obj_field.typ.is_plural(); let is_nullable = obj_field.is_nullable; @@ -1256,7 +1256,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { }; quote! { - if let Some(array) = arrays_by_name.get(#field_typ_fqname_str) { + if let Some(array) = arrays_by_descr.get(&Self::#descr_fn_name()) { <#component>::from_arrow_opt(&**array) .with_context(#obj_field_fqname)? #quoted_collection @@ -1266,7 +1266,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { } } else if is_nullable { quote! { - if let Some(array) = arrays_by_name.get(#field_typ_fqname_str) { + if let Some(array) = arrays_by_descr.get(&Self::#descr_fn_name()) { Some({ <#component>::from_arrow_opt(&**array) .with_context(#obj_field_fqname)? @@ -1278,8 +1278,8 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { } } else { quote! {{ - let array = arrays_by_name - .get(#field_typ_fqname_str) + let array = arrays_by_descr + .get(&Self::#descr_fn_name()) .ok_or_else(DeserializationError::missing_data) .with_context(#obj_field_fqname)?; @@ -1359,7 +1359,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { #[inline] fn from_arrow_components( arrow_data: impl IntoIterator, ) -> DeserializationResult { @@ -1367,12 +1367,7 @@ fn quote_trait_impls_for_archetype(obj: &Object) -> TokenStream { use ::re_types_core::{Loggable as _, ResultExt as _}; - // NOTE: Even though ComponentName is an InternedString, we must - // convert to &str here because the .get("component.name") accessors - // will fail otherwise. - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)).collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); #(#all_deserializers;)* diff --git a/crates/store/re_types/src/archetypes/annotation_context.rs b/crates/store/re_types/src/archetypes/annotation_context.rs index a53b871fbf21a..46c624eed0997 100644 --- a/crates/store/re_types/src/archetypes/annotation_context.rs +++ b/crates/store/re_types/src/archetypes/annotation_context.rs @@ -163,17 +163,14 @@ impl ::re_types_core::Archetype for AnnotationContext { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let context = { - let array = arrays_by_name - .get("rerun.components.AnnotationContext") + let array = arrays_by_descr + .get(&Self::descriptor_context()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.AnnotationContext#context")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/archetypes/arrows2d.rs b/crates/store/re_types/src/archetypes/arrows2d.rs index 39d9b66419daa..8f5b6bd3bb0e7 100644 --- a/crates/store/re_types/src/archetypes/arrows2d.rs +++ b/crates/store/re_types/src/archetypes/arrows2d.rs @@ -266,17 +266,14 @@ impl ::re_types_core::Archetype for Arrows2D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let vectors = { - let array = arrays_by_name - .get("rerun.components.Vector2D") + let array = arrays_by_descr + .get(&Self::descriptor_vectors()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Arrows2D#vectors")?; ::from_arrow_opt(&**array) @@ -286,7 +283,7 @@ impl ::re_types_core::Archetype for Arrows2D { .collect::>>() .with_context("rerun.archetypes.Arrows2D#vectors")? }; - let origins = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { + let origins = if let Some(array) = arrays_by_descr.get(&Self::descriptor_origins()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#origins")? @@ -298,7 +295,7 @@ impl ::re_types_core::Archetype for Arrows2D { } else { None }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#radii")? @@ -310,7 +307,7 @@ impl ::re_types_core::Archetype for Arrows2D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#colors")? @@ -322,7 +319,7 @@ impl ::re_types_core::Archetype for Arrows2D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#labels")? @@ -334,7 +331,8 @@ impl ::re_types_core::Archetype for Arrows2D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#show_labels")? .into_iter() @@ -343,7 +341,7 @@ impl ::re_types_core::Archetype for Arrows2D { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#draw_order")? .into_iter() @@ -352,7 +350,7 @@ impl ::re_types_core::Archetype for Arrows2D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows2D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/arrows3d.rs b/crates/store/re_types/src/archetypes/arrows3d.rs index 6bb11ae968e18..9b5e0a42cf513 100644 --- a/crates/store/re_types/src/archetypes/arrows3d.rs +++ b/crates/store/re_types/src/archetypes/arrows3d.rs @@ -262,17 +262,14 @@ impl ::re_types_core::Archetype for Arrows3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let vectors = { - let array = arrays_by_name - .get("rerun.components.Vector3D") + let array = arrays_by_descr + .get(&Self::descriptor_vectors()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Arrows3D#vectors")?; ::from_arrow_opt(&**array) @@ -282,7 +279,7 @@ impl ::re_types_core::Archetype for Arrows3D { .collect::>>() .with_context("rerun.archetypes.Arrows3D#vectors")? }; - let origins = if let Some(array) = arrays_by_name.get("rerun.components.Position3D") { + let origins = if let Some(array) = arrays_by_descr.get(&Self::descriptor_origins()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#origins")? @@ -294,7 +291,7 @@ impl ::re_types_core::Archetype for Arrows3D { } else { None }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#radii")? @@ -306,7 +303,7 @@ impl ::re_types_core::Archetype for Arrows3D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#colors")? @@ -318,7 +315,7 @@ impl ::re_types_core::Archetype for Arrows3D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#labels")? @@ -330,7 +327,8 @@ impl ::re_types_core::Archetype for Arrows3D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#show_labels")? .into_iter() @@ -339,7 +337,7 @@ impl ::re_types_core::Archetype for Arrows3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/asset3d.rs b/crates/store/re_types/src/archetypes/asset3d.rs index 7521cd4d61347..f81cb11028e18 100644 --- a/crates/store/re_types/src/archetypes/asset3d.rs +++ b/crates/store/re_types/src/archetypes/asset3d.rs @@ -193,17 +193,14 @@ impl ::re_types_core::Archetype for Asset3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let blob = { - let array = arrays_by_name - .get("rerun.components.Blob") + let array = arrays_by_descr + .get(&Self::descriptor_blob()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#blob")?; ::from_arrow_opt(&**array) @@ -214,7 +211,7 @@ impl ::re_types_core::Archetype for Asset3D { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#blob")? }; - let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { + let media_type = if let Some(array) = arrays_by_descr.get(&Self::descriptor_media_type()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Asset3D#media_type")? .into_iter() @@ -223,16 +220,16 @@ impl ::re_types_core::Archetype for Asset3D { } else { None }; - let albedo_factor = if let Some(array) = arrays_by_name.get("rerun.components.AlbedoFactor") - { - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Asset3D#albedo_factor")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let albedo_factor = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_albedo_factor()) { + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Asset3D#albedo_factor")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { blob, media_type, diff --git a/crates/store/re_types/src/archetypes/asset_video.rs b/crates/store/re_types/src/archetypes/asset_video.rs index 0b7a9a7b8b75a..879a619102303 100644 --- a/crates/store/re_types/src/archetypes/asset_video.rs +++ b/crates/store/re_types/src/archetypes/asset_video.rs @@ -243,17 +243,14 @@ impl ::re_types_core::Archetype for AssetVideo { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let blob = { - let array = arrays_by_name - .get("rerun.components.Blob") + let array = arrays_by_descr + .get(&Self::descriptor_blob()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.AssetVideo#blob")?; ::from_arrow_opt(&**array) @@ -264,7 +261,7 @@ impl ::re_types_core::Archetype for AssetVideo { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.AssetVideo#blob")? }; - let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { + let media_type = if let Some(array) = arrays_by_descr.get(&Self::descriptor_media_type()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.AssetVideo#media_type")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/bar_chart.rs b/crates/store/re_types/src/archetypes/bar_chart.rs index 9266923588a8a..ed1a5f6314d5f 100644 --- a/crates/store/re_types/src/archetypes/bar_chart.rs +++ b/crates/store/re_types/src/archetypes/bar_chart.rs @@ -154,17 +154,14 @@ impl ::re_types_core::Archetype for BarChart { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let values = { - let array = arrays_by_name - .get("rerun.components.TensorData") + let array = arrays_by_descr + .get(&Self::descriptor_values()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.BarChart#values")?; ::from_arrow_opt(&**array) @@ -175,7 +172,7 @@ impl ::re_types_core::Archetype for BarChart { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.BarChart#values")? }; - let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let color = if let Some(array) = arrays_by_descr.get(&Self::descriptor_color()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.BarChart#color")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/boxes2d.rs b/crates/store/re_types/src/archetypes/boxes2d.rs index e63a642cf1490..05434a8800090 100644 --- a/crates/store/re_types/src/archetypes/boxes2d.rs +++ b/crates/store/re_types/src/archetypes/boxes2d.rs @@ -259,17 +259,14 @@ impl ::re_types_core::Archetype for Boxes2D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let half_sizes = { - let array = arrays_by_name - .get("rerun.components.HalfSize2D") + let array = arrays_by_descr + .get(&Self::descriptor_half_sizes()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes2D#half_sizes")?; ::from_arrow_opt(&**array) @@ -279,7 +276,7 @@ impl ::re_types_core::Archetype for Boxes2D { .collect::>>() .with_context("rerun.archetypes.Boxes2D#half_sizes")? }; - let centers = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { + let centers = if let Some(array) = arrays_by_descr.get(&Self::descriptor_centers()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#centers")? @@ -291,7 +288,7 @@ impl ::re_types_core::Archetype for Boxes2D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#colors")? @@ -303,7 +300,7 @@ impl ::re_types_core::Archetype for Boxes2D { } else { None }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#radii")? @@ -315,7 +312,7 @@ impl ::re_types_core::Archetype for Boxes2D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#labels")? @@ -327,7 +324,8 @@ impl ::re_types_core::Archetype for Boxes2D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#show_labels")? .into_iter() @@ -336,7 +334,7 @@ impl ::re_types_core::Archetype for Boxes2D { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#draw_order")? .into_iter() @@ -345,7 +343,7 @@ impl ::re_types_core::Archetype for Boxes2D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/boxes3d.rs b/crates/store/re_types/src/archetypes/boxes3d.rs index ff315f90f4f18..77081336ee7da 100644 --- a/crates/store/re_types/src/archetypes/boxes3d.rs +++ b/crates/store/re_types/src/archetypes/boxes3d.rs @@ -313,17 +313,14 @@ impl ::re_types_core::Archetype for Boxes3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let half_sizes = { - let array = arrays_by_name - .get("rerun.components.HalfSize3D") + let array = arrays_by_descr + .get(&Self::descriptor_half_sizes()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes3D#half_sizes")?; ::from_arrow_opt(&**array) @@ -333,8 +330,7 @@ impl ::re_types_core::Archetype for Boxes3D { .collect::>>() .with_context("rerun.archetypes.Boxes3D#half_sizes")? }; - let centers = if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") - { + let centers = if let Some(array) = arrays_by_descr.get(&Self::descriptor_centers()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#centers")? @@ -347,7 +343,7 @@ impl ::re_types_core::Archetype for Boxes3D { None }; let rotation_axis_angles = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_rotation_axis_angles()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#rotation_axis_angles")? @@ -359,20 +355,20 @@ impl ::re_types_core::Archetype for Boxes3D { } else { None }; - let quaternions = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Boxes3D#quaternions")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Boxes3D#quaternions")? - }) - } else { - None - }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let quaternions = if let Some(array) = arrays_by_descr.get(&Self::descriptor_quaternions()) + { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Boxes3D#quaternions")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Boxes3D#quaternions")? + }) + } else { + None + }; + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#colors")? @@ -384,7 +380,7 @@ impl ::re_types_core::Archetype for Boxes3D { } else { None }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#radii")? @@ -396,7 +392,7 @@ impl ::re_types_core::Archetype for Boxes3D { } else { None }; - let fill_mode = if let Some(array) = arrays_by_name.get("rerun.components.FillMode") { + let fill_mode = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fill_mode()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#fill_mode")? .into_iter() @@ -405,7 +401,7 @@ impl ::re_types_core::Archetype for Boxes3D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#labels")? @@ -417,7 +413,8 @@ impl ::re_types_core::Archetype for Boxes3D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#show_labels")? .into_iter() @@ -426,7 +423,7 @@ impl ::re_types_core::Archetype for Boxes3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/capsules3d.rs b/crates/store/re_types/src/archetypes/capsules3d.rs index cde7146f436e9..6cfdb3123738b 100644 --- a/crates/store/re_types/src/archetypes/capsules3d.rs +++ b/crates/store/re_types/src/archetypes/capsules3d.rs @@ -307,17 +307,14 @@ impl ::re_types_core::Archetype for Capsules3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let lengths = { - let array = arrays_by_name - .get("rerun.components.Length") + let array = arrays_by_descr + .get(&Self::descriptor_lengths()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Capsules3D#lengths")?; ::from_arrow_opt(&**array) @@ -328,8 +325,8 @@ impl ::re_types_core::Archetype for Capsules3D { .with_context("rerun.archetypes.Capsules3D#lengths")? }; let radii = { - let array = arrays_by_name - .get("rerun.components.Radius") + let array = arrays_by_descr + .get(&Self::descriptor_radii()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Capsules3D#radii")?; ::from_arrow_opt(&**array) @@ -340,7 +337,7 @@ impl ::re_types_core::Archetype for Capsules3D { .with_context("rerun.archetypes.Capsules3D#radii")? }; let translations = - if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_translations()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#translations")? @@ -353,7 +350,7 @@ impl ::re_types_core::Archetype for Capsules3D { None }; let rotation_axis_angles = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_rotation_axis_angles()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#rotation_axis_angles")? @@ -365,20 +362,20 @@ impl ::re_types_core::Archetype for Capsules3D { } else { None }; - let quaternions = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Capsules3D#quaternions")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Capsules3D#quaternions")? - }) - } else { - None - }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let quaternions = if let Some(array) = arrays_by_descr.get(&Self::descriptor_quaternions()) + { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Capsules3D#quaternions")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Capsules3D#quaternions")? + }) + } else { + None + }; + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#colors")? @@ -390,7 +387,7 @@ impl ::re_types_core::Archetype for Capsules3D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#labels")? @@ -402,7 +399,8 @@ impl ::re_types_core::Archetype for Capsules3D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#show_labels")? .into_iter() @@ -411,7 +409,7 @@ impl ::re_types_core::Archetype for Capsules3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Capsules3D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/depth_image.rs b/crates/store/re_types/src/archetypes/depth_image.rs index 11beeea781fd4..0ea59252fcee0 100644 --- a/crates/store/re_types/src/archetypes/depth_image.rs +++ b/crates/store/re_types/src/archetypes/depth_image.rs @@ -281,17 +281,14 @@ impl ::re_types_core::Archetype for DepthImage { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let buffer = { - let array = arrays_by_name - .get("rerun.components.ImageBuffer") + let array = arrays_by_descr + .get(&Self::descriptor_buffer()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#buffer")?; ::from_arrow_opt(&**array) @@ -303,8 +300,8 @@ impl ::re_types_core::Archetype for DepthImage { .with_context("rerun.archetypes.DepthImage#buffer")? }; let format = { - let array = arrays_by_name - .get("rerun.components.ImageFormat") + let array = arrays_by_descr + .get(&Self::descriptor_format()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#format")?; ::from_arrow_opt(&**array) @@ -315,7 +312,7 @@ impl ::re_types_core::Archetype for DepthImage { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#format")? }; - let meter = if let Some(array) = arrays_by_name.get("rerun.components.DepthMeter") { + let meter = if let Some(array) = arrays_by_descr.get(&Self::descriptor_meter()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#meter")? .into_iter() @@ -324,7 +321,7 @@ impl ::re_types_core::Archetype for DepthImage { } else { None }; - let colormap = if let Some(array) = arrays_by_name.get("rerun.components.Colormap") { + let colormap = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colormap()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#colormap")? .into_iter() @@ -333,7 +330,8 @@ impl ::re_types_core::Archetype for DepthImage { } else { None }; - let depth_range = if let Some(array) = arrays_by_name.get("rerun.components.ValueRange") { + let depth_range = if let Some(array) = arrays_by_descr.get(&Self::descriptor_depth_range()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#depth_range")? .into_iter() @@ -342,17 +340,17 @@ impl ::re_types_core::Archetype for DepthImage { } else { None }; - let point_fill_ratio = if let Some(array) = arrays_by_name.get("rerun.components.FillRatio") - { - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.DepthImage#point_fill_ratio")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let point_fill_ratio = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_point_fill_ratio()) { + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.DepthImage#point_fill_ratio")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#draw_order")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/ellipsoids3d.rs b/crates/store/re_types/src/archetypes/ellipsoids3d.rs index 298b0dc8c72fc..ef5863d567b49 100644 --- a/crates/store/re_types/src/archetypes/ellipsoids3d.rs +++ b/crates/store/re_types/src/archetypes/ellipsoids3d.rs @@ -328,17 +328,14 @@ impl ::re_types_core::Archetype for Ellipsoids3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let half_sizes = { - let array = arrays_by_name - .get("rerun.components.HalfSize3D") + let array = arrays_by_descr + .get(&Self::descriptor_half_sizes()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Ellipsoids3D#half_sizes")?; ::from_arrow_opt(&**array) @@ -348,8 +345,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { .collect::>>() .with_context("rerun.archetypes.Ellipsoids3D#half_sizes")? }; - let centers = if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") - { + let centers = if let Some(array) = arrays_by_descr.get(&Self::descriptor_centers()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#centers")? @@ -362,7 +358,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { None }; let rotation_axis_angles = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_rotation_axis_angles()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#rotation_axis_angles")? @@ -374,20 +370,20 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } else { None }; - let quaternions = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Ellipsoids3D#quaternions")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Ellipsoids3D#quaternions")? - }) - } else { - None - }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let quaternions = if let Some(array) = arrays_by_descr.get(&Self::descriptor_quaternions()) + { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Ellipsoids3D#quaternions")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Ellipsoids3D#quaternions")? + }) + } else { + None + }; + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#colors")? @@ -399,7 +395,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } else { None }; - let line_radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let line_radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_line_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#line_radii")? @@ -411,7 +407,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } else { None }; - let fill_mode = if let Some(array) = arrays_by_name.get("rerun.components.FillMode") { + let fill_mode = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fill_mode()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#fill_mode")? .into_iter() @@ -420,7 +416,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#labels")? @@ -432,7 +428,8 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#show_labels")? .into_iter() @@ -441,7 +438,7 @@ impl ::re_types_core::Archetype for Ellipsoids3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Ellipsoids3D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/encoded_image.rs b/crates/store/re_types/src/archetypes/encoded_image.rs index 06cbdfc4fe80a..795213edfd257 100644 --- a/crates/store/re_types/src/archetypes/encoded_image.rs +++ b/crates/store/re_types/src/archetypes/encoded_image.rs @@ -197,17 +197,14 @@ impl ::re_types_core::Archetype for EncodedImage { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let blob = { - let array = arrays_by_name - .get("rerun.components.Blob") + let array = arrays_by_descr + .get(&Self::descriptor_blob()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.EncodedImage#blob")?; ::from_arrow_opt(&**array) @@ -218,7 +215,7 @@ impl ::re_types_core::Archetype for EncodedImage { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.EncodedImage#blob")? }; - let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { + let media_type = if let Some(array) = arrays_by_descr.get(&Self::descriptor_media_type()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#media_type")? .into_iter() @@ -227,7 +224,7 @@ impl ::re_types_core::Archetype for EncodedImage { } else { None }; - let opacity = if let Some(array) = arrays_by_name.get("rerun.components.Opacity") { + let opacity = if let Some(array) = arrays_by_descr.get(&Self::descriptor_opacity()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#opacity")? .into_iter() @@ -236,7 +233,7 @@ impl ::re_types_core::Archetype for EncodedImage { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.EncodedImage#draw_order")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/geo_line_strings.rs b/crates/store/re_types/src/archetypes/geo_line_strings.rs index 31b18ba536658..362e813bb0f7c 100644 --- a/crates/store/re_types/src/archetypes/geo_line_strings.rs +++ b/crates/store/re_types/src/archetypes/geo_line_strings.rs @@ -185,17 +185,14 @@ impl ::re_types_core::Archetype for GeoLineStrings { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let line_strings = { - let array = arrays_by_name - .get("rerun.components.GeoLineString") + let array = arrays_by_descr + .get(&Self::descriptor_line_strings()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GeoLineStrings#line_strings")?; ::from_arrow_opt(&**array) @@ -205,7 +202,7 @@ impl ::re_types_core::Archetype for GeoLineStrings { .collect::>>() .with_context("rerun.archetypes.GeoLineStrings#line_strings")? }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoLineStrings#radii")? @@ -217,7 +214,7 @@ impl ::re_types_core::Archetype for GeoLineStrings { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoLineStrings#colors")? diff --git a/crates/store/re_types/src/archetypes/geo_points.rs b/crates/store/re_types/src/archetypes/geo_points.rs index 80f8c1e410055..1934ade73f87f 100644 --- a/crates/store/re_types/src/archetypes/geo_points.rs +++ b/crates/store/re_types/src/archetypes/geo_points.rs @@ -192,17 +192,14 @@ impl ::re_types_core::Archetype for GeoPoints { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let positions = { - let array = arrays_by_name - .get("rerun.components.LatLon") + let array = arrays_by_descr + .get(&Self::descriptor_positions()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GeoPoints#positions")?; ::from_arrow_opt(&**array) @@ -212,7 +209,7 @@ impl ::re_types_core::Archetype for GeoPoints { .collect::>>() .with_context("rerun.archetypes.GeoPoints#positions")? }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#radii")? @@ -224,7 +221,7 @@ impl ::re_types_core::Archetype for GeoPoints { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#colors")? @@ -236,7 +233,7 @@ impl ::re_types_core::Archetype for GeoPoints { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GeoPoints#class_ids")? diff --git a/crates/store/re_types/src/archetypes/graph_edges.rs b/crates/store/re_types/src/archetypes/graph_edges.rs index 6371259a5cdf4..10b9b0a24b66a 100644 --- a/crates/store/re_types/src/archetypes/graph_edges.rs +++ b/crates/store/re_types/src/archetypes/graph_edges.rs @@ -166,17 +166,14 @@ impl ::re_types_core::Archetype for GraphEdges { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let edges = { - let array = arrays_by_name - .get("rerun.components.GraphEdge") + let array = arrays_by_descr + .get(&Self::descriptor_edges()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GraphEdges#edges")?; ::from_arrow_opt(&**array) @@ -186,7 +183,7 @@ impl ::re_types_core::Archetype for GraphEdges { .collect::>>() .with_context("rerun.archetypes.GraphEdges#edges")? }; - let graph_type = if let Some(array) = arrays_by_name.get("rerun.components.GraphType") { + let graph_type = if let Some(array) = arrays_by_descr.get(&Self::descriptor_graph_type()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphEdges#graph_type")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/graph_nodes.rs b/crates/store/re_types/src/archetypes/graph_nodes.rs index 8186855da835b..176e1bb557308 100644 --- a/crates/store/re_types/src/archetypes/graph_nodes.rs +++ b/crates/store/re_types/src/archetypes/graph_nodes.rs @@ -221,17 +221,14 @@ impl ::re_types_core::Archetype for GraphNodes { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let node_ids = { - let array = arrays_by_name - .get("rerun.components.GraphNode") + let array = arrays_by_descr + .get(&Self::descriptor_node_ids()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.GraphNodes#node_ids")?; ::from_arrow_opt(&**array) @@ -241,7 +238,7 @@ impl ::re_types_core::Archetype for GraphNodes { .collect::>>() .with_context("rerun.archetypes.GraphNodes#node_ids")? }; - let positions = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { + let positions = if let Some(array) = arrays_by_descr.get(&Self::descriptor_positions()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#positions")? @@ -253,7 +250,7 @@ impl ::re_types_core::Archetype for GraphNodes { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#colors")? @@ -265,7 +262,7 @@ impl ::re_types_core::Archetype for GraphNodes { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#labels")? @@ -277,7 +274,8 @@ impl ::re_types_core::Archetype for GraphNodes { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#show_labels")? .into_iter() @@ -286,7 +284,7 @@ impl ::re_types_core::Archetype for GraphNodes { } else { None }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.GraphNodes#radii")? diff --git a/crates/store/re_types/src/archetypes/image.rs b/crates/store/re_types/src/archetypes/image.rs index 25d6705fcbca6..6e0ee68ab5c3e 100644 --- a/crates/store/re_types/src/archetypes/image.rs +++ b/crates/store/re_types/src/archetypes/image.rs @@ -266,17 +266,14 @@ impl ::re_types_core::Archetype for Image { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let buffer = { - let array = arrays_by_name - .get("rerun.components.ImageBuffer") + let array = arrays_by_descr + .get(&Self::descriptor_buffer()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Image#buffer")?; ::from_arrow_opt(&**array) @@ -288,8 +285,8 @@ impl ::re_types_core::Archetype for Image { .with_context("rerun.archetypes.Image#buffer")? }; let format = { - let array = arrays_by_name - .get("rerun.components.ImageFormat") + let array = arrays_by_descr + .get(&Self::descriptor_format()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Image#format")?; ::from_arrow_opt(&**array) @@ -300,7 +297,7 @@ impl ::re_types_core::Archetype for Image { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Image#format")? }; - let opacity = if let Some(array) = arrays_by_name.get("rerun.components.Opacity") { + let opacity = if let Some(array) = arrays_by_descr.get(&Self::descriptor_opacity()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#opacity")? .into_iter() @@ -309,7 +306,7 @@ impl ::re_types_core::Archetype for Image { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#draw_order")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/instance_poses3d.rs b/crates/store/re_types/src/archetypes/instance_poses3d.rs index b4bcf815c8385..b1d4dd13f7a5d 100644 --- a/crates/store/re_types/src/archetypes/instance_poses3d.rs +++ b/crates/store/re_types/src/archetypes/instance_poses3d.rs @@ -248,16 +248,13 @@ impl ::re_types_core::Archetype for InstancePoses3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let translations = - if let Some(array) = arrays_by_name.get("rerun.components.PoseTranslation3D") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_translations()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#translations")? @@ -270,7 +267,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { None }; let rotation_axis_angles = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationAxisAngle") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_rotation_axis_angles()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#rotation_axis_angles")? @@ -282,20 +279,20 @@ impl ::re_types_core::Archetype for InstancePoses3D { } else { None }; - let quaternions = - if let Some(array) = arrays_by_name.get("rerun.components.PoseRotationQuat") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.InstancePoses3D#quaternions")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.InstancePoses3D#quaternions")? - }) - } else { - None - }; - let scales = if let Some(array) = arrays_by_name.get("rerun.components.PoseScale3D") { + let quaternions = if let Some(array) = arrays_by_descr.get(&Self::descriptor_quaternions()) + { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.InstancePoses3D#quaternions")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.InstancePoses3D#quaternions")? + }) + } else { + None + }; + let scales = if let Some(array) = arrays_by_descr.get(&Self::descriptor_scales()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#scales")? @@ -307,8 +304,7 @@ impl ::re_types_core::Archetype for InstancePoses3D { } else { None }; - let mat3x3 = if let Some(array) = arrays_by_name.get("rerun.components.PoseTransformMat3x3") - { + let mat3x3 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_mat3x3()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.InstancePoses3D#mat3x3")? diff --git a/crates/store/re_types/src/archetypes/line_strips2d.rs b/crates/store/re_types/src/archetypes/line_strips2d.rs index f59c7b2fe77b6..0280b098c2098 100644 --- a/crates/store/re_types/src/archetypes/line_strips2d.rs +++ b/crates/store/re_types/src/archetypes/line_strips2d.rs @@ -283,17 +283,14 @@ impl ::re_types_core::Archetype for LineStrips2D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let strips = { - let array = arrays_by_name - .get("rerun.components.LineStrip2D") + let array = arrays_by_descr + .get(&Self::descriptor_strips()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips2D#strips")?; ::from_arrow_opt(&**array) @@ -303,7 +300,7 @@ impl ::re_types_core::Archetype for LineStrips2D { .collect::>>() .with_context("rerun.archetypes.LineStrips2D#strips")? }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#radii")? @@ -315,7 +312,7 @@ impl ::re_types_core::Archetype for LineStrips2D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#colors")? @@ -327,7 +324,7 @@ impl ::re_types_core::Archetype for LineStrips2D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#labels")? @@ -339,7 +336,8 @@ impl ::re_types_core::Archetype for LineStrips2D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#show_labels")? .into_iter() @@ -348,7 +346,7 @@ impl ::re_types_core::Archetype for LineStrips2D { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#draw_order")? .into_iter() @@ -357,7 +355,7 @@ impl ::re_types_core::Archetype for LineStrips2D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/line_strips3d.rs b/crates/store/re_types/src/archetypes/line_strips3d.rs index c9d3c89ed9b95..e7b70cd37243d 100644 --- a/crates/store/re_types/src/archetypes/line_strips3d.rs +++ b/crates/store/re_types/src/archetypes/line_strips3d.rs @@ -279,17 +279,14 @@ impl ::re_types_core::Archetype for LineStrips3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let strips = { - let array = arrays_by_name - .get("rerun.components.LineStrip3D") + let array = arrays_by_descr + .get(&Self::descriptor_strips()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips3D#strips")?; ::from_arrow_opt(&**array) @@ -299,7 +296,7 @@ impl ::re_types_core::Archetype for LineStrips3D { .collect::>>() .with_context("rerun.archetypes.LineStrips3D#strips")? }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#radii")? @@ -311,7 +308,7 @@ impl ::re_types_core::Archetype for LineStrips3D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#colors")? @@ -323,7 +320,7 @@ impl ::re_types_core::Archetype for LineStrips3D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#labels")? @@ -335,7 +332,8 @@ impl ::re_types_core::Archetype for LineStrips3D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#show_labels")? .into_iter() @@ -344,7 +342,7 @@ impl ::re_types_core::Archetype for LineStrips3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/mesh3d.rs b/crates/store/re_types/src/archetypes/mesh3d.rs index 5093db01c82e9..c6cd40cb1b7cd 100644 --- a/crates/store/re_types/src/archetypes/mesh3d.rs +++ b/crates/store/re_types/src/archetypes/mesh3d.rs @@ -336,17 +336,14 @@ impl ::re_types_core::Archetype for Mesh3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let vertex_positions = { - let array = arrays_by_name - .get("rerun.components.Position3D") + let array = arrays_by_descr + .get(&Self::descriptor_vertex_positions()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Mesh3D#vertex_positions")?; ::from_arrow_opt(&**array) @@ -357,7 +354,7 @@ impl ::re_types_core::Archetype for Mesh3D { .with_context("rerun.archetypes.Mesh3D#vertex_positions")? }; let triangle_indices = - if let Some(array) = arrays_by_name.get("rerun.components.TriangleIndices") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_triangle_indices()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#triangle_indices")? @@ -369,32 +366,34 @@ impl ::re_types_core::Archetype for Mesh3D { } else { None }; - let vertex_normals = if let Some(array) = arrays_by_name.get("rerun.components.Vector3D") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Mesh3D#vertex_normals")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Mesh3D#vertex_normals")? - }) - } else { - None - }; - let vertex_colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Mesh3D#vertex_colors")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Mesh3D#vertex_colors")? - }) - } else { - None - }; + let vertex_normals = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_vertex_normals()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Mesh3D#vertex_normals")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Mesh3D#vertex_normals")? + }) + } else { + None + }; + let vertex_colors = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_vertex_colors()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Mesh3D#vertex_colors")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Mesh3D#vertex_colors")? + }) + } else { + None + }; let vertex_texcoords = - if let Some(array) = arrays_by_name.get("rerun.components.Texcoord2D") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_vertex_texcoords()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_texcoords")? @@ -406,18 +405,18 @@ impl ::re_types_core::Archetype for Mesh3D { } else { None }; - let albedo_factor = if let Some(array) = arrays_by_name.get("rerun.components.AlbedoFactor") - { - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Mesh3D#albedo_factor")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let albedo_factor = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_albedo_factor()) { + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Mesh3D#albedo_factor")? + .into_iter() + .next() + .flatten() + } else { + None + }; let albedo_texture_buffer = - if let Some(array) = arrays_by_name.get("rerun.components.ImageBuffer") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_albedo_texture_buffer()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#albedo_texture_buffer")? .into_iter() @@ -427,7 +426,7 @@ impl ::re_types_core::Archetype for Mesh3D { None }; let albedo_texture_format = - if let Some(array) = arrays_by_name.get("rerun.components.ImageFormat") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_albedo_texture_format()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#albedo_texture_format")? .into_iter() @@ -436,7 +435,7 @@ impl ::re_types_core::Archetype for Mesh3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#class_ids")? diff --git a/crates/store/re_types/src/archetypes/pinhole.rs b/crates/store/re_types/src/archetypes/pinhole.rs index 75524c97e438d..8e984d718c497 100644 --- a/crates/store/re_types/src/archetypes/pinhole.rs +++ b/crates/store/re_types/src/archetypes/pinhole.rs @@ -267,17 +267,14 @@ impl ::re_types_core::Archetype for Pinhole { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let image_from_camera = { - let array = arrays_by_name - .get("rerun.components.PinholeProjection") + let array = arrays_by_descr + .get(&Self::descriptor_image_from_camera()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#image_from_camera")?; ::from_arrow_opt(&**array) @@ -288,7 +285,7 @@ impl ::re_types_core::Archetype for Pinhole { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#image_from_camera")? }; - let resolution = if let Some(array) = arrays_by_name.get("rerun.components.Resolution") { + let resolution = if let Some(array) = arrays_by_descr.get(&Self::descriptor_resolution()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#resolution")? .into_iter() @@ -297,8 +294,7 @@ impl ::re_types_core::Archetype for Pinhole { } else { None }; - let camera_xyz = if let Some(array) = arrays_by_name.get("rerun.components.ViewCoordinates") - { + let camera_xyz = if let Some(array) = arrays_by_descr.get(&Self::descriptor_camera_xyz()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#camera_xyz")? .into_iter() @@ -308,7 +304,7 @@ impl ::re_types_core::Archetype for Pinhole { None }; let image_plane_distance = - if let Some(array) = arrays_by_name.get("rerun.components.ImagePlaneDistance") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_image_plane_distance()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#image_plane_distance")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/points2d.rs b/crates/store/re_types/src/archetypes/points2d.rs index dbadf1148a638..3aaa10eb19460 100644 --- a/crates/store/re_types/src/archetypes/points2d.rs +++ b/crates/store/re_types/src/archetypes/points2d.rs @@ -316,17 +316,14 @@ impl ::re_types_core::Archetype for Points2D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let positions = { - let array = arrays_by_name - .get("rerun.components.Position2D") + let array = arrays_by_descr + .get(&Self::descriptor_positions()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Points2D#positions")?; ::from_arrow_opt(&**array) @@ -336,7 +333,7 @@ impl ::re_types_core::Archetype for Points2D { .collect::>>() .with_context("rerun.archetypes.Points2D#positions")? }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#radii")? @@ -348,7 +345,7 @@ impl ::re_types_core::Archetype for Points2D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#colors")? @@ -360,7 +357,7 @@ impl ::re_types_core::Archetype for Points2D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#labels")? @@ -372,7 +369,8 @@ impl ::re_types_core::Archetype for Points2D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#show_labels")? .into_iter() @@ -381,7 +379,7 @@ impl ::re_types_core::Archetype for Points2D { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#draw_order")? .into_iter() @@ -390,7 +388,7 @@ impl ::re_types_core::Archetype for Points2D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#class_ids")? @@ -402,18 +400,19 @@ impl ::re_types_core::Archetype for Points2D { } else { None }; - let keypoint_ids = if let Some(array) = arrays_by_name.get("rerun.components.KeypointId") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Points2D#keypoint_ids")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Points2D#keypoint_ids")? - }) - } else { - None - }; + let keypoint_ids = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_keypoint_ids()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Points2D#keypoint_ids")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Points2D#keypoint_ids")? + }) + } else { + None + }; Ok(Self { positions, radii, diff --git a/crates/store/re_types/src/archetypes/points3d.rs b/crates/store/re_types/src/archetypes/points3d.rs index 4e51d42badb56..33bd5bcaa3bcf 100644 --- a/crates/store/re_types/src/archetypes/points3d.rs +++ b/crates/store/re_types/src/archetypes/points3d.rs @@ -297,17 +297,14 @@ impl ::re_types_core::Archetype for Points3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let positions = { - let array = arrays_by_name - .get("rerun.components.Position3D") + let array = arrays_by_descr + .get(&Self::descriptor_positions()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Points3D#positions")?; ::from_arrow_opt(&**array) @@ -317,7 +314,7 @@ impl ::re_types_core::Archetype for Points3D { .collect::>>() .with_context("rerun.archetypes.Points3D#positions")? }; - let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { + let radii = if let Some(array) = arrays_by_descr.get(&Self::descriptor_radii()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#radii")? @@ -329,7 +326,7 @@ impl ::re_types_core::Archetype for Points3D { } else { None }; - let colors = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let colors = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colors()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#colors")? @@ -341,7 +338,7 @@ impl ::re_types_core::Archetype for Points3D { } else { None }; - let labels = if let Some(array) = arrays_by_name.get("rerun.components.Text") { + let labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_labels()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#labels")? @@ -353,7 +350,8 @@ impl ::re_types_core::Archetype for Points3D { } else { None }; - let show_labels = if let Some(array) = arrays_by_name.get("rerun.components.ShowLabels") { + let show_labels = if let Some(array) = arrays_by_descr.get(&Self::descriptor_show_labels()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#show_labels")? .into_iter() @@ -362,7 +360,7 @@ impl ::re_types_core::Archetype for Points3D { } else { None }; - let class_ids = if let Some(array) = arrays_by_name.get("rerun.components.ClassId") { + let class_ids = if let Some(array) = arrays_by_descr.get(&Self::descriptor_class_ids()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#class_ids")? @@ -374,18 +372,19 @@ impl ::re_types_core::Archetype for Points3D { } else { None }; - let keypoint_ids = if let Some(array) = arrays_by_name.get("rerun.components.KeypointId") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.Points3D#keypoint_ids")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.archetypes.Points3D#keypoint_ids")? - }) - } else { - None - }; + let keypoint_ids = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_keypoint_ids()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.Points3D#keypoint_ids")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.archetypes.Points3D#keypoint_ids")? + }) + } else { + None + }; Ok(Self { positions, radii, diff --git a/crates/store/re_types/src/archetypes/scalar.rs b/crates/store/re_types/src/archetypes/scalar.rs index 24f92629f31fd..32c439cdeba42 100644 --- a/crates/store/re_types/src/archetypes/scalar.rs +++ b/crates/store/re_types/src/archetypes/scalar.rs @@ -142,17 +142,14 @@ impl ::re_types_core::Archetype for Scalar { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let scalar = { - let array = arrays_by_name - .get("rerun.components.Scalar") + let array = arrays_by_descr + .get(&Self::descriptor_scalar()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Scalar#scalar")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/archetypes/segmentation_image.rs b/crates/store/re_types/src/archetypes/segmentation_image.rs index f852817c0175d..139115f765d18 100644 --- a/crates/store/re_types/src/archetypes/segmentation_image.rs +++ b/crates/store/re_types/src/archetypes/segmentation_image.rs @@ -214,17 +214,14 @@ impl ::re_types_core::Archetype for SegmentationImage { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let buffer = { - let array = arrays_by_name - .get("rerun.components.ImageBuffer") + let array = arrays_by_descr + .get(&Self::descriptor_buffer()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#buffer")?; ::from_arrow_opt(&**array) @@ -236,8 +233,8 @@ impl ::re_types_core::Archetype for SegmentationImage { .with_context("rerun.archetypes.SegmentationImage#buffer")? }; let format = { - let array = arrays_by_name - .get("rerun.components.ImageFormat") + let array = arrays_by_descr + .get(&Self::descriptor_format()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#format")?; ::from_arrow_opt(&**array) @@ -248,7 +245,7 @@ impl ::re_types_core::Archetype for SegmentationImage { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#format")? }; - let opacity = if let Some(array) = arrays_by_name.get("rerun.components.Opacity") { + let opacity = if let Some(array) = arrays_by_descr.get(&Self::descriptor_opacity()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#opacity")? .into_iter() @@ -257,7 +254,7 @@ impl ::re_types_core::Archetype for SegmentationImage { } else { None }; - let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { + let draw_order = if let Some(array) = arrays_by_descr.get(&Self::descriptor_draw_order()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#draw_order")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/series_line.rs b/crates/store/re_types/src/archetypes/series_line.rs index 0f6407314bdb8..a19722217d347 100644 --- a/crates/store/re_types/src/archetypes/series_line.rs +++ b/crates/store/re_types/src/archetypes/series_line.rs @@ -218,15 +218,12 @@ impl ::re_types_core::Archetype for SeriesLine { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let color = if let Some(array) = arrays_by_descr.get(&Self::descriptor_color()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#color")? .into_iter() @@ -235,7 +232,7 @@ impl ::re_types_core::Archetype for SeriesLine { } else { None }; - let width = if let Some(array) = arrays_by_name.get("rerun.components.StrokeWidth") { + let width = if let Some(array) = arrays_by_descr.get(&Self::descriptor_width()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#width")? .into_iter() @@ -244,7 +241,7 @@ impl ::re_types_core::Archetype for SeriesLine { } else { None }; - let name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { + let name = if let Some(array) = arrays_by_descr.get(&Self::descriptor_name()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#name")? .into_iter() @@ -254,7 +251,7 @@ impl ::re_types_core::Archetype for SeriesLine { None }; let aggregation_policy = - if let Some(array) = arrays_by_name.get("rerun.components.AggregationPolicy") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_aggregation_policy()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesLine#aggregation_policy")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/series_point.rs b/crates/store/re_types/src/archetypes/series_point.rs index 4639279ce0aba..28c4924b984a2 100644 --- a/crates/store/re_types/src/archetypes/series_point.rs +++ b/crates/store/re_types/src/archetypes/series_point.rs @@ -216,15 +216,12 @@ impl ::re_types_core::Archetype for SeriesPoint { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let color = if let Some(array) = arrays_by_descr.get(&Self::descriptor_color()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#color")? .into_iter() @@ -233,7 +230,7 @@ impl ::re_types_core::Archetype for SeriesPoint { } else { None }; - let marker = if let Some(array) = arrays_by_name.get("rerun.components.MarkerShape") { + let marker = if let Some(array) = arrays_by_descr.get(&Self::descriptor_marker()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#marker")? .into_iter() @@ -242,7 +239,7 @@ impl ::re_types_core::Archetype for SeriesPoint { } else { None }; - let name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { + let name = if let Some(array) = arrays_by_descr.get(&Self::descriptor_name()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#name")? .into_iter() @@ -251,7 +248,8 @@ impl ::re_types_core::Archetype for SeriesPoint { } else { None }; - let marker_size = if let Some(array) = arrays_by_name.get("rerun.components.MarkerSize") { + let marker_size = if let Some(array) = arrays_by_descr.get(&Self::descriptor_marker_size()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SeriesPoint#marker_size")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/tensor.rs b/crates/store/re_types/src/archetypes/tensor.rs index a3e6ab751271c..b0a430afa7e3e 100644 --- a/crates/store/re_types/src/archetypes/tensor.rs +++ b/crates/store/re_types/src/archetypes/tensor.rs @@ -166,17 +166,14 @@ impl ::re_types_core::Archetype for Tensor { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let data = { - let array = arrays_by_name - .get("rerun.components.TensorData") + let array = arrays_by_descr + .get(&Self::descriptor_data()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Tensor#data")?; ::from_arrow_opt(&**array) @@ -187,7 +184,8 @@ impl ::re_types_core::Archetype for Tensor { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Tensor#data")? }; - let value_range = if let Some(array) = arrays_by_name.get("rerun.components.ValueRange") { + let value_range = if let Some(array) = arrays_by_descr.get(&Self::descriptor_value_range()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Tensor#value_range")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/text_document.rs b/crates/store/re_types/src/archetypes/text_document.rs index db9e3dbf4dfe4..c0163e38bfed4 100644 --- a/crates/store/re_types/src/archetypes/text_document.rs +++ b/crates/store/re_types/src/archetypes/text_document.rs @@ -201,17 +201,14 @@ impl ::re_types_core::Archetype for TextDocument { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let text = { - let array = arrays_by_name - .get("rerun.components.Text") + let array = arrays_by_descr + .get(&Self::descriptor_text()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.TextDocument#text")?; ::from_arrow_opt(&**array) @@ -222,7 +219,7 @@ impl ::re_types_core::Archetype for TextDocument { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.TextDocument#text")? }; - let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { + let media_type = if let Some(array) = arrays_by_descr.get(&Self::descriptor_media_type()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextDocument#media_type")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/text_log.rs b/crates/store/re_types/src/archetypes/text_log.rs index cd24949847ec9..f793585d07645 100644 --- a/crates/store/re_types/src/archetypes/text_log.rs +++ b/crates/store/re_types/src/archetypes/text_log.rs @@ -182,17 +182,14 @@ impl ::re_types_core::Archetype for TextLog { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let text = { - let array = arrays_by_name - .get("rerun.components.Text") + let array = arrays_by_descr + .get(&Self::descriptor_text()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#text")?; ::from_arrow_opt(&**array) @@ -203,7 +200,7 @@ impl ::re_types_core::Archetype for TextLog { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#text")? }; - let level = if let Some(array) = arrays_by_name.get("rerun.components.TextLogLevel") { + let level = if let Some(array) = arrays_by_descr.get(&Self::descriptor_level()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextLog#level")? .into_iter() @@ -212,7 +209,7 @@ impl ::re_types_core::Archetype for TextLog { } else { None }; - let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let color = if let Some(array) = arrays_by_descr.get(&Self::descriptor_color()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextLog#color")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/transform3d.rs b/crates/store/re_types/src/archetypes/transform3d.rs index 7314c2e5d7263..956b11b83fc48 100644 --- a/crates/store/re_types/src/archetypes/transform3d.rs +++ b/crates/store/re_types/src/archetypes/transform3d.rs @@ -357,15 +357,12 @@ impl ::re_types_core::Archetype for Transform3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let translation = if let Some(array) = arrays_by_name.get("rerun.components.Translation3D") + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let translation = if let Some(array) = arrays_by_descr.get(&Self::descriptor_translation()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#translation")? @@ -376,7 +373,7 @@ impl ::re_types_core::Archetype for Transform3D { None }; let rotation_axis_angle = - if let Some(array) = arrays_by_name.get("rerun.components.RotationAxisAngle") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_rotation_axis_angle()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#rotation_axis_angle")? .into_iter() @@ -385,7 +382,7 @@ impl ::re_types_core::Archetype for Transform3D { } else { None }; - let quaternion = if let Some(array) = arrays_by_name.get("rerun.components.RotationQuat") { + let quaternion = if let Some(array) = arrays_by_descr.get(&Self::descriptor_quaternion()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#quaternion")? .into_iter() @@ -394,7 +391,7 @@ impl ::re_types_core::Archetype for Transform3D { } else { None }; - let scale = if let Some(array) = arrays_by_name.get("rerun.components.Scale3D") { + let scale = if let Some(array) = arrays_by_descr.get(&Self::descriptor_scale()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#scale")? .into_iter() @@ -403,7 +400,7 @@ impl ::re_types_core::Archetype for Transform3D { } else { None }; - let mat3x3 = if let Some(array) = arrays_by_name.get("rerun.components.TransformMat3x3") { + let mat3x3 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_mat3x3()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#mat3x3")? .into_iter() @@ -412,8 +409,7 @@ impl ::re_types_core::Archetype for Transform3D { } else { None }; - let relation = if let Some(array) = arrays_by_name.get("rerun.components.TransformRelation") - { + let relation = if let Some(array) = arrays_by_descr.get(&Self::descriptor_relation()) { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#relation")? .into_iter() @@ -422,7 +418,8 @@ impl ::re_types_core::Archetype for Transform3D { } else { None }; - let axis_length = if let Some(array) = arrays_by_name.get("rerun.components.AxisLength") { + let axis_length = if let Some(array) = arrays_by_descr.get(&Self::descriptor_axis_length()) + { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#axis_length")? .into_iter() diff --git a/crates/store/re_types/src/archetypes/video_frame_reference.rs b/crates/store/re_types/src/archetypes/video_frame_reference.rs index c8b97239b437a..2afacca0e0cb8 100644 --- a/crates/store/re_types/src/archetypes/video_frame_reference.rs +++ b/crates/store/re_types/src/archetypes/video_frame_reference.rs @@ -246,17 +246,14 @@ impl ::re_types_core::Archetype for VideoFrameReference { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let timestamp = { - let array = arrays_by_name - .get("rerun.components.VideoTimestamp") + let array = arrays_by_descr + .get(&Self::descriptor_timestamp()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.VideoFrameReference#timestamp")?; ::from_arrow_opt(&**array) @@ -267,16 +264,16 @@ impl ::re_types_core::Archetype for VideoFrameReference { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.VideoFrameReference#timestamp")? }; - let video_reference = if let Some(array) = arrays_by_name.get("rerun.components.EntityPath") - { - ::from_arrow_opt(&**array) - .with_context("rerun.archetypes.VideoFrameReference#video_reference")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let video_reference = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_video_reference()) { + ::from_arrow_opt(&**array) + .with_context("rerun.archetypes.VideoFrameReference#video_reference")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { timestamp, video_reference, diff --git a/crates/store/re_types/src/archetypes/view_coordinates.rs b/crates/store/re_types/src/archetypes/view_coordinates.rs index b5a7d875c0873..f81be2c5a02ac 100644 --- a/crates/store/re_types/src/archetypes/view_coordinates.rs +++ b/crates/store/re_types/src/archetypes/view_coordinates.rs @@ -154,17 +154,14 @@ impl ::re_types_core::Archetype for ViewCoordinates { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let xyz = { - let array = arrays_by_name - .get("rerun.components.ViewCoordinates") + let array = arrays_by_descr + .get(&Self::descriptor_xyz()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.ViewCoordinates#xyz")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/background.rs b/crates/store/re_types/src/blueprint/archetypes/background.rs index 57443643507b7..7ab89ed7bbbe3 100644 --- a/crates/store/re_types/src/blueprint/archetypes/background.rs +++ b/crates/store/re_types/src/blueprint/archetypes/background.rs @@ -127,17 +127,14 @@ impl ::re_types_core::Archetype for Background { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let kind = { - let array = arrays_by_name - .get("rerun.blueprint.components.BackgroundKind") + let array = arrays_by_descr + .get(&Self::descriptor_kind()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.Background#kind")?; ::from_arrow_opt(&**array) @@ -148,7 +145,7 @@ impl ::re_types_core::Archetype for Background { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.Background#kind")? }; - let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let color = if let Some(array) = arrays_by_descr.get(&Self::descriptor_color()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.Background#color")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs index 06d88ac97c4db..cf38f7676d7f2 100644 --- a/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/container_blueprint.rs @@ -238,17 +238,14 @@ impl ::re_types_core::Archetype for ContainerBlueprint { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let container_kind = { - let array = arrays_by_name - .get("rerun.blueprint.components.ContainerKind") + let array = arrays_by_descr + .get(&Self::descriptor_container_kind()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#container_kind")?; ::from_arrow_opt(&**array) @@ -259,66 +256,62 @@ impl ::re_types_core::Archetype for ContainerBlueprint { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#container_kind")? }; - let display_name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#display_name")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let contents = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.IncludedContent") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#contents")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#contents")? - }) - } else { - None - }; - let col_shares = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ColumnShare") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#col_shares")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#col_shares")? - }) - } else { - None - }; - let row_shares = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.RowShare") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#row_shares")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#row_shares")? - }) - } else { - None - }; - let active_tab = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ActiveTab") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ContainerBlueprint#active_tab")? + let display_name = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_display_name()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#display_name")? .into_iter() .next() .flatten() } else { None }; - let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") - { + let contents = if let Some(array) = arrays_by_descr.get(&Self::descriptor_contents()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#contents")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#contents")? + }) + } else { + None + }; + let col_shares = if let Some(array) = arrays_by_descr.get(&Self::descriptor_col_shares()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#col_shares")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#col_shares")? + }) + } else { + None + }; + let row_shares = if let Some(array) = arrays_by_descr.get(&Self::descriptor_row_shares()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#row_shares")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#row_shares")? + }) + } else { + None + }; + let active_tab = if let Some(array) = arrays_by_descr.get(&Self::descriptor_active_tab()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ContainerBlueprint#active_tab")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let visible = if let Some(array) = arrays_by_descr.get(&Self::descriptor_visible()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#visible")? .into_iter() @@ -328,7 +321,7 @@ impl ::re_types_core::Archetype for ContainerBlueprint { None }; let grid_columns = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.GridColumns") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_grid_columns()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ContainerBlueprint#grid_columns")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs b/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs index 29d28f4c521bc..ffe0a6c419f3f 100644 --- a/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs +++ b/crates/store/re_types/src/blueprint/archetypes/dataframe_query.rs @@ -181,26 +181,22 @@ impl ::re_types_core::Archetype for DataframeQuery { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let timeline = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.TimelineName") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.DataframeQuery#timeline")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let timeline = if let Some(array) = arrays_by_descr.get(&Self::descriptor_timeline()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.DataframeQuery#timeline")? + .into_iter() + .next() + .flatten() + } else { + None + }; let filter_by_range = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.FilterByRange") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_filter_by_range()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#filter_by_range")? .into_iter() @@ -210,7 +206,7 @@ impl ::re_types_core::Archetype for DataframeQuery { None }; let filter_is_not_null = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.FilterIsNotNull") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_filter_is_not_null()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#filter_is_not_null")? .into_iter() @@ -220,7 +216,7 @@ impl ::re_types_core::Archetype for DataframeQuery { None }; let apply_latest_at = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ApplyLatestAt") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_apply_latest_at()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.DataframeQuery#apply_latest_at")? .into_iter() @@ -229,16 +225,15 @@ impl ::re_types_core::Archetype for DataframeQuery { } else { None }; - let select = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.SelectedColumns") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.DataframeQuery#select")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let select = if let Some(array) = arrays_by_descr.get(&Self::descriptor_select()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.DataframeQuery#select")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { timeline, filter_by_range, diff --git a/crates/store/re_types/src/blueprint/archetypes/force_center.rs b/crates/store/re_types/src/blueprint/archetypes/force_center.rs index b9250ac38e67c..0f97a4bb43450 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_center.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_center.rs @@ -134,16 +134,12 @@ impl ::re_types_core::Archetype for ForceCenter { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let enabled = if let Some(array) = arrays_by_descr.get(&Self::descriptor_enabled()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCenter#enabled")? .into_iter() @@ -152,16 +148,15 @@ impl ::re_types_core::Archetype for ForceCenter { } else { None }; - let strength = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForceCenter#strength")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let strength = if let Some(array) = arrays_by_descr.get(&Self::descriptor_strength()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForceCenter#strength")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { enabled, strength }) } } diff --git a/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs b/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs index 95eaccbeda11c..44cb5548da8f4 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_collision_radius.rs @@ -152,16 +152,12 @@ impl ::re_types_core::Archetype for ForceCollisionRadius { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let enabled = if let Some(array) = arrays_by_descr.get(&Self::descriptor_enabled()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#enabled")? .into_iter() @@ -170,26 +166,24 @@ impl ::re_types_core::Archetype for ForceCollisionRadius { } else { None }; - let strength = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#strength")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let iterations = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceIterations") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#iterations")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let strength = if let Some(array) = arrays_by_descr.get(&Self::descriptor_strength()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#strength")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let iterations = if let Some(array) = arrays_by_descr.get(&Self::descriptor_iterations()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForceCollisionRadius#iterations")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { enabled, strength, diff --git a/crates/store/re_types/src/blueprint/archetypes/force_link.rs b/crates/store/re_types/src/blueprint/archetypes/force_link.rs index 27fd69040f607..8e1b0e3e8372f 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_link.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_link.rs @@ -151,16 +151,12 @@ impl ::re_types_core::Archetype for ForceLink { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let enabled = if let Some(array) = arrays_by_descr.get(&Self::descriptor_enabled()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceLink#enabled")? .into_iter() @@ -169,26 +165,24 @@ impl ::re_types_core::Archetype for ForceLink { } else { None }; - let distance = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceDistance") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForceLink#distance")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let iterations = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceIterations") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForceLink#iterations")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let distance = if let Some(array) = arrays_by_descr.get(&Self::descriptor_distance()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForceLink#distance")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let iterations = if let Some(array) = arrays_by_descr.get(&Self::descriptor_iterations()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForceLink#iterations")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { enabled, distance, diff --git a/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs b/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs index 13f305dd6117c..ec364a91cea95 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_many_body.rs @@ -139,16 +139,12 @@ impl ::re_types_core::Archetype for ForceManyBody { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let enabled = if let Some(array) = arrays_by_descr.get(&Self::descriptor_enabled()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForceManyBody#enabled")? .into_iter() @@ -157,16 +153,15 @@ impl ::re_types_core::Archetype for ForceManyBody { } else { None }; - let strength = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForceManyBody#strength")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let strength = if let Some(array) = arrays_by_descr.get(&Self::descriptor_strength()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForceManyBody#strength")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { enabled, strength }) } } diff --git a/crates/store/re_types/src/blueprint/archetypes/force_position.rs b/crates/store/re_types/src/blueprint/archetypes/force_position.rs index 6483001f3a909..b2412e4b617b5 100644 --- a/crates/store/re_types/src/blueprint/archetypes/force_position.rs +++ b/crates/store/re_types/src/blueprint/archetypes/force_position.rs @@ -149,16 +149,12 @@ impl ::re_types_core::Archetype for ForcePosition { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let enabled = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Enabled") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let enabled = if let Some(array) = arrays_by_descr.get(&Self::descriptor_enabled()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForcePosition#enabled")? .into_iter() @@ -167,17 +163,16 @@ impl ::re_types_core::Archetype for ForcePosition { } else { None }; - let strength = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ForceStrength") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ForcePosition#strength")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let position = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { + let strength = if let Some(array) = arrays_by_descr.get(&Self::descriptor_strength()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ForcePosition#strength")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let position = if let Some(array) = arrays_by_descr.get(&Self::descriptor_position()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ForcePosition#position")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs b/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs index c1f0781b50e60..496ed5cf92dc7 100644 --- a/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs +++ b/crates/store/re_types/src/blueprint/archetypes/line_grid3d.rs @@ -189,16 +189,12 @@ impl ::re_types_core::Archetype for LineGrid3D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let visible = if let Some(array) = arrays_by_descr.get(&Self::descriptor_visible()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#visible")? .into_iter() @@ -207,35 +203,35 @@ impl ::re_types_core::Archetype for LineGrid3D { } else { None }; - let spacing = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.GridSpacing") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.LineGrid3D#spacing")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let plane = if let Some(array) = arrays_by_name.get("rerun.components.Plane3D") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.LineGrid3D#plane")? + let spacing = if let Some(array) = arrays_by_descr.get(&Self::descriptor_spacing()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.LineGrid3D#spacing")? .into_iter() .next() .flatten() } else { None }; - let stroke_width = if let Some(array) = arrays_by_name.get("rerun.components.StrokeWidth") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.LineGrid3D#stroke_width")? + let plane = if let Some(array) = arrays_by_descr.get(&Self::descriptor_plane()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.LineGrid3D#plane")? .into_iter() .next() .flatten() } else { None }; - let color = if let Some(array) = arrays_by_name.get("rerun.components.Color") { + let stroke_width = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_stroke_width()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.LineGrid3D#stroke_width")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let color = if let Some(array) = arrays_by_descr.get(&Self::descriptor_color()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.LineGrid3D#color")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/map_background.rs b/crates/store/re_types/src/blueprint/archetypes/map_background.rs index 72fecb09f9807..cfbd868dfbf6e 100644 --- a/crates/store/re_types/src/blueprint/archetypes/map_background.rs +++ b/crates/store/re_types/src/blueprint/archetypes/map_background.rs @@ -115,17 +115,14 @@ impl ::re_types_core::Archetype for MapBackground { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let provider = { - let array = arrays_by_name - .get("rerun.blueprint.components.MapProvider") + let array = arrays_by_descr + .get(&Self::descriptor_provider()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.MapBackground#provider")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs b/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs index 44a9a07a539d1..c251ed93accf7 100644 --- a/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs +++ b/crates/store/re_types/src/blueprint/archetypes/map_zoom.rs @@ -110,17 +110,14 @@ impl ::re_types_core::Archetype for MapZoom { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let zoom = { - let array = arrays_by_name - .get("rerun.blueprint.components.ZoomLevel") + let array = arrays_by_descr + .get(&Self::descriptor_zoom()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.MapZoom#zoom")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs b/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs index 05723fd95ae56..821e600f05a27 100644 --- a/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs +++ b/crates/store/re_types/src/blueprint/archetypes/near_clip_plane.rs @@ -115,17 +115,14 @@ impl ::re_types_core::Archetype for NearClipPlane { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let near_clip_plane = { - let array = arrays_by_name - .get("rerun.blueprint.components.NearClipPlane") + let array = arrays_by_descr + .get(&Self::descriptor_near_clip_plane()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.NearClipPlane#near_clip_plane")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs index c4c35c3958648..fa197eae2c1ab 100644 --- a/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/panel_blueprint.rs @@ -113,16 +113,12 @@ impl ::re_types_core::Archetype for PanelBlueprint { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let state = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.PanelState") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let state = if let Some(array) = arrays_by_descr.get(&Self::descriptor_state()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.PanelBlueprint#state")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs b/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs index 80fc8b5264ec8..93536284ed46a 100644 --- a/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs +++ b/crates/store/re_types/src/blueprint/archetypes/plot_legend.rs @@ -136,16 +136,12 @@ impl ::re_types_core::Archetype for PlotLegend { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let corner = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Corner2D") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let corner = if let Some(array) = arrays_by_descr.get(&Self::descriptor_corner()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.PlotLegend#corner")? .into_iter() @@ -154,8 +150,7 @@ impl ::re_types_core::Archetype for PlotLegend { } else { None }; - let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") - { + let visible = if let Some(array) = arrays_by_descr.get(&Self::descriptor_visible()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.PlotLegend#visible")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs b/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs index 01c01dac3cf0a..368a0b90efcb7 100644 --- a/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs +++ b/crates/store/re_types/src/blueprint/archetypes/scalar_axis.rs @@ -134,15 +134,12 @@ impl ::re_types_core::Archetype for ScalarAxis { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let range = if let Some(array) = arrays_by_name.get("rerun.components.Range1D") { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let range = if let Some(array) = arrays_by_descr.get(&Self::descriptor_range()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ScalarAxis#range")? .into_iter() @@ -151,9 +148,7 @@ impl ::re_types_core::Archetype for ScalarAxis { } else { None }; - let zoom_lock = if let Some(array) = - arrays_by_name.get("rerun.blueprint.components.LockRangeDuringZoom") - { + let zoom_lock = if let Some(array) = arrays_by_descr.get(&Self::descriptor_zoom_lock()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ScalarAxis#zoom_lock")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs b/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs index a1f0184f682bf..d030c8614c235 100644 --- a/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs +++ b/crates/store/re_types/src/blueprint/archetypes/tensor_scalar_mapping.rs @@ -156,25 +156,21 @@ impl ::re_types_core::Archetype for TensorScalarMapping { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let mag_filter = - if let Some(array) = arrays_by_name.get("rerun.components.MagnificationFilter") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.TensorScalarMapping#mag_filter")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let colormap = if let Some(array) = arrays_by_name.get("rerun.components.Colormap") { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let mag_filter = if let Some(array) = arrays_by_descr.get(&Self::descriptor_mag_filter()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.TensorScalarMapping#mag_filter")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let colormap = if let Some(array) = arrays_by_descr.get(&Self::descriptor_colormap()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorScalarMapping#colormap")? .into_iter() @@ -183,7 +179,7 @@ impl ::re_types_core::Archetype for TensorScalarMapping { } else { None }; - let gamma = if let Some(array) = arrays_by_name.get("rerun.components.GammaCorrection") { + let gamma = if let Some(array) = arrays_by_descr.get(&Self::descriptor_gamma()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorScalarMapping#gamma")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs b/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs index bca8e2b675334..ccb2278997527 100644 --- a/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs +++ b/crates/store/re_types/src/blueprint/archetypes/tensor_slice_selection.rs @@ -173,16 +173,12 @@ impl ::re_types_core::Archetype for TensorSliceSelection { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let width = if let Some(array) = arrays_by_name.get("rerun.components.TensorWidthDimension") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let width = if let Some(array) = arrays_by_descr.get(&Self::descriptor_width()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorSliceSelection#width")? .into_iter() @@ -191,19 +187,16 @@ impl ::re_types_core::Archetype for TensorSliceSelection { } else { None }; - let height = - if let Some(array) = arrays_by_name.get("rerun.components.TensorHeightDimension") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.TensorSliceSelection#height")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let indices = if let Some(array) = - arrays_by_name.get("rerun.components.TensorDimensionIndexSelection") - { + let height = if let Some(array) = arrays_by_descr.get(&Self::descriptor_height()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.TensorSliceSelection#height")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let indices = if let Some(array) = arrays_by_descr.get(&Self::descriptor_indices()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorSliceSelection#indices")? @@ -215,9 +208,7 @@ impl ::re_types_core::Archetype for TensorSliceSelection { } else { None }; - let slider = if let Some(array) = - arrays_by_name.get("rerun.blueprint.components.TensorDimensionIndexSlider") - { + let slider = if let Some(array) = arrays_by_descr.get(&Self::descriptor_slider()) { Some({ ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorSliceSelection#slider")? diff --git a/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs b/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs index 3919fefdcab0d..2e82f018aa1bb 100644 --- a/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs +++ b/crates/store/re_types/src/blueprint/archetypes/tensor_view_fit.rs @@ -113,16 +113,12 @@ impl ::re_types_core::Archetype for TensorViewFit { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let scaling = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ViewFit") - { + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let scaling = if let Some(array) = arrays_by_descr.get(&Self::descriptor_scaling()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.TensorViewFit#scaling")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs index 53cbda7545e44..0ae6e1fbbf1b0 100644 --- a/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/view_blueprint.rs @@ -169,17 +169,14 @@ impl ::re_types_core::Archetype for ViewBlueprint { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let class_identifier = { - let array = arrays_by_name - .get("rerun.blueprint.components.ViewClass") + let array = arrays_by_descr + .get(&Self::descriptor_class_identifier()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ViewBlueprint#class_identifier")?; ::from_arrow_opt(&**array) @@ -190,17 +187,18 @@ impl ::re_types_core::Archetype for ViewBlueprint { .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ViewBlueprint#class_identifier")? }; - let display_name = if let Some(array) = arrays_by_name.get("rerun.components.Name") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ViewBlueprint#display_name")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let display_name = + if let Some(array) = arrays_by_descr.get(&Self::descriptor_display_name()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ViewBlueprint#display_name")? + .into_iter() + .next() + .flatten() + } else { + None + }; let space_origin = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ViewOrigin") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_space_origin()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewBlueprint#space_origin")? .into_iter() @@ -209,8 +207,7 @@ impl ::re_types_core::Archetype for ViewBlueprint { } else { None }; - let visible = if let Some(array) = arrays_by_name.get("rerun.blueprint.components.Visible") - { + let visible = if let Some(array) = arrays_by_descr.get(&Self::descriptor_visible()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewBlueprint#visible")? .into_iter() diff --git a/crates/store/re_types/src/blueprint/archetypes/view_contents.rs b/crates/store/re_types/src/blueprint/archetypes/view_contents.rs index 265ac29c00a33..1739475c1e29b 100644 --- a/crates/store/re_types/src/blueprint/archetypes/view_contents.rs +++ b/crates/store/re_types/src/blueprint/archetypes/view_contents.rs @@ -152,17 +152,14 @@ impl ::re_types_core::Archetype for ViewContents { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let query = { - let array = arrays_by_name - .get("rerun.blueprint.components.QueryExpression") + let array = arrays_by_descr + .get(&Self::descriptor_query()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.ViewContents#query")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs b/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs index e200f3a6d3e6c..bca398edba824 100644 --- a/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs +++ b/crates/store/re_types/src/blueprint/archetypes/viewport_blueprint.rs @@ -190,16 +190,13 @@ impl ::re_types_core::Archetype for ViewportBlueprint { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let root_container = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.RootContainer") { + if let Some(array) = arrays_by_descr.get(&Self::descriptor_root_container()) { ::from_arrow_opt(&**array) .with_context("rerun.blueprint.archetypes.ViewportBlueprint#root_container")? .into_iter() @@ -208,38 +205,36 @@ impl ::re_types_core::Archetype for ViewportBlueprint { } else { None }; - let maximized = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.ViewMaximized") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ViewportBlueprint#maximized")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let auto_layout = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.AutoLayout") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ViewportBlueprint#auto_layout")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let auto_views = - if let Some(array) = arrays_by_name.get("rerun.blueprint.components.AutoViews") { - ::from_arrow_opt(&**array) - .with_context("rerun.blueprint.archetypes.ViewportBlueprint#auto_views")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let maximized = if let Some(array) = arrays_by_descr.get(&Self::descriptor_maximized()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ViewportBlueprint#maximized")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let auto_layout = if let Some(array) = arrays_by_descr.get(&Self::descriptor_auto_layout()) + { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ViewportBlueprint#auto_layout")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let auto_views = if let Some(array) = arrays_by_descr.get(&Self::descriptor_auto_views()) { + ::from_arrow_opt(&**array) + .with_context("rerun.blueprint.archetypes.ViewportBlueprint#auto_views")? + .into_iter() + .next() + .flatten() + } else { + None + }; let past_viewer_recommendations = if let Some(array) = - arrays_by_name.get("rerun.blueprint.components.ViewerRecommendationHash") + arrays_by_descr.get(&Self::descriptor_past_viewer_recommendations()) { Some({ ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs b/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs index 49fb6c94bcb97..b32ea79b19263 100644 --- a/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs +++ b/crates/store/re_types/src/blueprint/archetypes/visible_time_ranges.rs @@ -123,17 +123,14 @@ impl ::re_types_core::Archetype for VisibleTimeRanges { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let ranges = { - let array = arrays_by_name - .get("rerun.blueprint.components.VisibleTimeRange") + let array = arrays_by_descr + .get(&Self::descriptor_ranges()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.VisibleTimeRanges#ranges")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs b/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs index d89e5ca63cf23..abacfe530feae 100644 --- a/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs +++ b/crates/store/re_types/src/blueprint/archetypes/visual_bounds2d.rs @@ -121,17 +121,14 @@ impl ::re_types_core::Archetype for VisualBounds2D { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let range = { - let array = arrays_by_name - .get("rerun.blueprint.components.VisualBounds2D") + let array = arrays_by_descr + .get(&Self::descriptor_range()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.blueprint.archetypes.VisualBounds2D#range")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs index d0cce34b18aeb..482b2ea77fdc8 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer1.rs @@ -388,17 +388,14 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let fuzz1001 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer1") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1001()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")?; ::from_arrow_opt(&**array) @@ -410,8 +407,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")? }; let fuzz1002 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer2") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1002()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")?; ::from_arrow_opt(&**array) @@ -423,8 +420,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")? }; let fuzz1003 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer3") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1003()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")?; ::from_arrow_opt(&**array) @@ -436,8 +433,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")? }; let fuzz1004 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer4") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1004()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")?; ::from_arrow_opt(&**array) @@ -449,8 +446,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")? }; let fuzz1005 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer5") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1005()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")?; ::from_arrow_opt(&**array) @@ -462,8 +459,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")? }; let fuzz1006 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer6") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1006()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")?; ::from_arrow_opt(&**array) @@ -475,8 +472,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")? }; let fuzz1007 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer7") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1007()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")?; ::from_arrow_opt(&**array) @@ -488,8 +485,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")? }; let fuzz1008 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer8") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1008()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")?; ::from_arrow_opt(&**array) @@ -501,8 +498,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")? }; let fuzz1009 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer9") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1009()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")?; ::from_arrow_opt(&**array) @@ -514,8 +511,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")? }; let fuzz1010 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer10") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1010()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")?; ::from_arrow_opt(&**array) @@ -527,8 +524,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")? }; let fuzz1011 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer11") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1011()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")?; ::from_arrow_opt(&**array) @@ -540,8 +537,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")? }; let fuzz1012 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer12") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1012()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")?; ::from_arrow_opt(&**array) @@ -553,8 +550,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")? }; let fuzz1013 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer13") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1013()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")?; ::from_arrow_opt(&**array) @@ -566,8 +563,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")? }; let fuzz1014 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer14") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1014()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")?; ::from_arrow_opt(&**array) @@ -579,8 +576,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")? }; let fuzz1015 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer15") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1015()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")?; ::from_arrow_opt(&**array) @@ -592,8 +589,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")? }; let fuzz1016 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer16") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1016()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")?; ::from_arrow_opt(&**array) @@ -605,8 +602,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")? }; let fuzz1017 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer17") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1017()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")?; ::from_arrow_opt(&**array) @@ -618,8 +615,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")? }; let fuzz1018 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer18") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1018()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")?; ::from_arrow_opt(&**array) @@ -631,8 +628,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")? }; let fuzz1019 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer19") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1019()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")?; ::from_arrow_opt(&**array) @@ -644,8 +641,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")? }; let fuzz1020 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer20") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1020()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")?; ::from_arrow_opt(&**array) @@ -657,8 +654,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")? }; let fuzz1021 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer21") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1021()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")?; ::from_arrow_opt(&**array) @@ -670,8 +667,8 @@ impl ::re_types_core::Archetype for AffixFuzzer1 { .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")? }; let fuzz1022 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer22") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1022()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1022")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs index 7fea451d85054..6cbf0a642ec32 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer2.rs @@ -349,17 +349,14 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let fuzz1101 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer1") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1101()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")?; ::from_arrow_opt(&**array) @@ -370,8 +367,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")? }; let fuzz1102 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer2") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1102()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")?; ::from_arrow_opt(&**array) @@ -382,8 +379,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")? }; let fuzz1103 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer3") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1103()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")?; ::from_arrow_opt(&**array) @@ -394,8 +391,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")? }; let fuzz1104 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer4") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1104()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")?; ::from_arrow_opt(&**array) @@ -406,8 +403,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")? }; let fuzz1105 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer5") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1105()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")?; ::from_arrow_opt(&**array) @@ -418,8 +415,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")? }; let fuzz1106 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer6") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1106()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")?; ::from_arrow_opt(&**array) @@ -430,8 +427,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")? }; let fuzz1107 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer7") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1107()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")?; ::from_arrow_opt(&**array) @@ -442,8 +439,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")? }; let fuzz1108 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer8") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1108()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")?; ::from_arrow_opt(&**array) @@ -454,8 +451,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")? }; let fuzz1109 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer9") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1109()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")?; ::from_arrow_opt(&**array) @@ -466,8 +463,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")? }; let fuzz1110 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer10") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1110()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")?; ::from_arrow_opt(&**array) @@ -478,8 +475,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")? }; let fuzz1111 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer11") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1111()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")?; ::from_arrow_opt(&**array) @@ -490,8 +487,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")? }; let fuzz1112 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer12") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1112()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")?; ::from_arrow_opt(&**array) @@ -502,8 +499,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")? }; let fuzz1113 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer13") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1113()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")?; ::from_arrow_opt(&**array) @@ -514,8 +511,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")? }; let fuzz1114 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer14") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1114()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")?; ::from_arrow_opt(&**array) @@ -526,8 +523,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")? }; let fuzz1115 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer15") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1115()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")?; ::from_arrow_opt(&**array) @@ -538,8 +535,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")? }; let fuzz1116 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer16") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1116()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")?; ::from_arrow_opt(&**array) @@ -550,8 +547,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")? }; let fuzz1117 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer17") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1117()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")?; ::from_arrow_opt(&**array) @@ -562,8 +559,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")? }; let fuzz1118 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer18") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1118()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")?; ::from_arrow_opt(&**array) @@ -574,8 +571,8 @@ impl ::re_types_core::Archetype for AffixFuzzer2 { .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")? }; let fuzz1122 = { - let array = arrays_by_name - .get("rerun.testing.components.AffixFuzzer22") + let array = arrays_by_descr + .get(&Self::descriptor_fuzz1122()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1122")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs index edcc3108eceea..b8d68b503664f 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer3.rs @@ -336,194 +336,173 @@ impl ::re_types_core::Archetype for AffixFuzzer3 { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let fuzz2001 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer1") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2001")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2002 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer2") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2002")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2003 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer3") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2003")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2004 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer4") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2004")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2005 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer5") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2005")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2006 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer6") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2006")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2007 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer7") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2007")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2008 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer8") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2008")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2009 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer9") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2009")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2010 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer10") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2010")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2011 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer11") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2011")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2012 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer12") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2012")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2013 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer13") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2013")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2014 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer14") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2014")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2015 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer15") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2015")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2016 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer16") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2016")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2017 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer17") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2017")? - .into_iter() - .next() - .flatten() - } else { - None - }; - let fuzz2018 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer18") { - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2018")? - .into_iter() - .next() - .flatten() - } else { - None - }; + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let fuzz2001 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2001()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2001")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2002 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2002()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2002")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2003 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2003()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2003")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2004 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2004()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2004")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2005 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2005()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2005")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2006 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2006()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2006")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2007 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2007()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2007")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2008 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2008()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2008")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2009 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2009()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2009")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2010 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2010()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2010")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2011 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2011()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2011")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2012 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2012()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2012")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2013 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2013()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2013")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2014 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2014()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2014")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2015 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2015()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2015")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2016 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2016()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2016")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2017 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2017()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2017")? + .into_iter() + .next() + .flatten() + } else { + None + }; + let fuzz2018 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2018()) { + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2018")? + .into_iter() + .next() + .flatten() + } else { + None + }; Ok(Self { fuzz2001, fuzz2002, diff --git a/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs b/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs index 6cc8d615c80b4..897a08968001f 100644 --- a/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs +++ b/crates/store/re_types/src/testing/archetypes/affix_fuzzer4.rs @@ -336,248 +336,227 @@ impl ::re_types_core::Archetype for AffixFuzzer4 { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use ::re_types_core::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); - let fuzz2101 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer1") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? - }) - } else { - None - }; - let fuzz2102 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer2") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? - }) - } else { - None - }; - let fuzz2103 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer3") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? - }) - } else { - None - }; - let fuzz2104 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer4") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? - }) - } else { - None - }; - let fuzz2105 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer5") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? - }) - } else { - None - }; - let fuzz2106 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer6") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? - }) - } else { - None - }; - let fuzz2107 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer7") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? - }) - } else { - None - }; - let fuzz2108 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer8") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? - }) - } else { - None - }; - let fuzz2109 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer9") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? - }) - } else { - None - }; - let fuzz2110 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer10") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? - }) - } else { - None - }; - let fuzz2111 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer11") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? - }) - } else { - None - }; - let fuzz2112 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer12") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? - }) - } else { - None - }; - let fuzz2113 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer13") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? - }) - } else { - None - }; - let fuzz2114 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer14") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? - }) - } else { - None - }; - let fuzz2115 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer15") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? - }) - } else { - None - }; - let fuzz2116 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer16") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? - }) - } else { - None - }; - let fuzz2117 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer17") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? - }) - } else { - None - }; - let fuzz2118 = - if let Some(array) = arrays_by_name.get("rerun.testing.components.AffixFuzzer18") { - Some({ - ::from_arrow_opt(&**array) - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? - .into_iter() - .map(|v| v.ok_or_else(DeserializationError::missing_data)) - .collect::>>() - .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? - }) - } else { - None - }; + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); + let fuzz2101 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2101()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? + }) + } else { + None + }; + let fuzz2102 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2102()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? + }) + } else { + None + }; + let fuzz2103 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2103()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? + }) + } else { + None + }; + let fuzz2104 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2104()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? + }) + } else { + None + }; + let fuzz2105 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2105()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? + }) + } else { + None + }; + let fuzz2106 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2106()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? + }) + } else { + None + }; + let fuzz2107 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2107()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? + }) + } else { + None + }; + let fuzz2108 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2108()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? + }) + } else { + None + }; + let fuzz2109 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2109()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? + }) + } else { + None + }; + let fuzz2110 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2110()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? + }) + } else { + None + }; + let fuzz2111 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2111()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? + }) + } else { + None + }; + let fuzz2112 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2112()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? + }) + } else { + None + }; + let fuzz2113 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2113()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? + }) + } else { + None + }; + let fuzz2114 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2114()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? + }) + } else { + None + }; + let fuzz2115 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2115()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? + }) + } else { + None + }; + let fuzz2116 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2116()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? + }) + } else { + None + }; + let fuzz2117 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2117()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? + }) + } else { + None + }; + let fuzz2118 = if let Some(array) = arrays_by_descr.get(&Self::descriptor_fuzz2118()) { + Some({ + ::from_arrow_opt(&**array) + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? + .into_iter() + .map(|v| v.ok_or_else(DeserializationError::missing_data)) + .collect::>>() + .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? + }) + } else { + None + }; Ok(Self { fuzz2101, fuzz2102, diff --git a/crates/store/re_types/tests/types/points3d.rs b/crates/store/re_types/tests/types/points3d.rs index 98dadd595a7ae..362d0b4a61107 100644 --- a/crates/store/re_types/tests/types/points3d.rs +++ b/crates/store/re_types/tests/types/points3d.rs @@ -43,9 +43,9 @@ fn roundtrip() { let serialized = arch.to_arrow().unwrap(); for (field, array) in &serialized { // NOTE: Keep those around please, very useful when debugging. - // eprintln!("field = {field:#?}"); - // eprintln!("array = {array:#?}"); - eprintln!("{} = {array:#?}", field.name()); + eprintln!("field = {field:#?}"); + eprintln!("array = {array:#?}"); + // eprintln!("{} = {array:#?}", field.name()); } let deserialized = Points3D::from_arrow(serialized).unwrap(); diff --git a/crates/store/re_types_core/src/archetype.rs b/crates/store/re_types_core/src/archetype.rs index 9c0bb82f733ef..9f03dee6e7dbf 100644 --- a/crates/store/re_types_core/src/archetype.rs +++ b/crates/store/re_types_core/src/archetype.rs @@ -109,7 +109,7 @@ pub trait Archetype { { Self::from_arrow_components( data.into_iter() - .map(|(field, array)| (ComponentName::new(field.name()), array)), + .map(|(field, array)| (ComponentDescriptor::from(field), array)), ) } @@ -120,7 +120,7 @@ pub trait Archetype { /// logged to stderr. #[inline] fn from_arrow_components( - data: impl IntoIterator, + data: impl IntoIterator, ) -> DeserializationResult where Self: Sized, @@ -139,14 +139,15 @@ pub trait Archetype { /// logged to stderr. #[inline] fn from_arrow2_components( - data: impl IntoIterator)>, + data: impl IntoIterator)>, ) -> DeserializationResult where Self: Sized, { - Self::from_arrow_components(data.into_iter().map(|(component, arrow2_array)| { - (component, arrow::array::ArrayRef::from(arrow2_array)) - })) + Self::from_arrow_components( + data.into_iter() + .map(|(descr, arrow2_array)| (descr, arrow::array::ArrayRef::from(arrow2_array))), + ) } } diff --git a/crates/store/re_types_core/src/archetypes/clear.rs b/crates/store/re_types_core/src/archetypes/clear.rs index 5f3e932288c0f..3f480bdb7a437 100644 --- a/crates/store/re_types_core/src/archetypes/clear.rs +++ b/crates/store/re_types_core/src/archetypes/clear.rs @@ -166,17 +166,14 @@ impl crate::Archetype for Clear { #[inline] fn from_arrow_components( - arrow_data: impl IntoIterator, + arrow_data: impl IntoIterator, ) -> DeserializationResult { re_tracing::profile_function!(); use crate::{Loggable as _, ResultExt as _}; - let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data - .into_iter() - .map(|(name, array)| (name.full_name(), array)) - .collect(); + let arrays_by_descr: ::nohash_hasher::IntMap<_, _> = arrow_data.into_iter().collect(); let is_recursive = { - let array = arrays_by_name - .get("rerun.components.ClearIsRecursive") + let array = arrays_by_descr + .get(&Self::descriptor_is_recursive()) .ok_or_else(DeserializationError::missing_data) .with_context("rerun.archetypes.Clear#is_recursive")?; ::from_arrow_opt(&**array) diff --git a/crates/store/re_types_core/src/as_components.rs b/crates/store/re_types_core/src/as_components.rs index afca52414553d..3e8448e3d1c94 100644 --- a/crates/store/re_types_core/src/as_components.rs +++ b/crates/store/re_types_core/src/as_components.rs @@ -77,14 +77,7 @@ pub trait AsComponents { ) -> SerializationResult> { self.as_component_batches_v2() .into_iter() - .map(|comp_batch| { - let field = arrow::datatypes::Field::new( - comp_batch.descriptor.component_name.to_string(), - comp_batch.array.data_type().clone(), - false, - ); - Ok((field, comp_batch.array)) - }) + .map(|comp_batch| Ok((arrow::datatypes::Field::from(&comp_batch), comp_batch.array))) .collect() } @@ -102,12 +95,10 @@ pub trait AsComponents { self.as_component_batches_v2() .into_iter() .map(|comp_batch| { - let field = arrow2::datatypes::Field::new( - comp_batch.descriptor.component_name.to_string(), - comp_batch.array.data_type().clone().into(), - false, - ); - Ok((field, comp_batch.array.into())) + Ok(( + arrow2::datatypes::Field::from(&comp_batch), + comp_batch.array.into(), + )) }) .collect() } diff --git a/crates/store/re_types_core/src/component_descriptor.rs b/crates/store/re_types_core/src/component_descriptor.rs index cf19c2d437e43..a5908e3a1e39f 100644 --- a/crates/store/re_types_core/src/component_descriptor.rs +++ b/crates/store/re_types_core/src/component_descriptor.rs @@ -181,3 +181,36 @@ impl ComponentDescriptor { self } } + +// --- + +// TODO(cmc): This is far from ideal and feels very hackish, but for now the priority is getting +// all things related to tags up and running so we can gather learnings. +// This is only used on the archetype deserialization path, which isn't ever used outside of tests anyway. + +// TODO(cmc): we really shouldn't be duplicating these. + +/// The key used to identify the [`crate::ArchetypeName`] in field-level metadata. +const FIELD_METADATA_KEY_ARCHETYPE_NAME: &str = "rerun.archetype_name"; + +/// The key used to identify the [`crate::ArchetypeFieldName`] in field-level metadata. +const FIELD_METADATA_KEY_ARCHETYPE_FIELD_NAME: &str = "rerun.archetype_field_name"; + +impl From for ComponentDescriptor { + #[inline] + fn from(field: arrow::datatypes::Field) -> Self { + let md = field.metadata(); + + Self { + archetype_name: md + .get(FIELD_METADATA_KEY_ARCHETYPE_NAME) + .cloned() + .map(Into::into), + archetype_field_name: md + .get(FIELD_METADATA_KEY_ARCHETYPE_FIELD_NAME) + .cloned() + .map(Into::into), + component_name: field.name().clone().into(), + } + } +} diff --git a/crates/store/re_types_core/src/loggable_batch.rs b/crates/store/re_types_core/src/loggable_batch.rs index 6be113c6f8075..666d568785a14 100644 --- a/crates/store/re_types_core/src/loggable_batch.rs +++ b/crates/store/re_types_core/src/loggable_batch.rs @@ -151,6 +151,11 @@ pub trait ComponentBatch: LoggableBatch { } } +#[allow(dead_code)] +fn assert_component_batch_object_safe() { + let _: &dyn LoggableBatch; +} + /// The serialized contents of a [`ComponentBatch`] with associated [`ComponentDescriptor`]. /// /// This is what gets logged into Rerun: @@ -191,11 +196,82 @@ impl SerializedComponentBatch { } } -#[allow(dead_code)] -fn assert_component_batch_object_safe() { - let _: &dyn LoggableBatch; +// --- + +// TODO(cmc): This is far from ideal and feels very hackish, but for now the priority is getting +// all things related to tags up and running so we can gather learnings. +// This is only used on the archetype deserialization path, which isn't ever used outside of tests anyway. + +// TODO(cmc): we really shouldn't be duplicating these. + +/// The key used to identify the [`crate::ArchetypeName`] in field-level metadata. +const FIELD_METADATA_KEY_ARCHETYPE_NAME: &str = "rerun.archetype_name"; + +/// The key used to identify the [`crate::ArchetypeFieldName`] in field-level metadata. +const FIELD_METADATA_KEY_ARCHETYPE_FIELD_NAME: &str = "rerun.archetype_field_name"; + +impl From<&SerializedComponentBatch> for arrow::datatypes::Field { + #[inline] + fn from(batch: &SerializedComponentBatch) -> Self { + Self::new( + batch.descriptor.component_name.to_string(), + batch.array.data_type().clone(), + false, + ) + .with_metadata( + [ + batch.descriptor.archetype_name.map(|name| { + ( + FIELD_METADATA_KEY_ARCHETYPE_NAME.to_owned(), + name.to_string(), + ) + }), + batch.descriptor.archetype_field_name.map(|name| { + ( + FIELD_METADATA_KEY_ARCHETYPE_FIELD_NAME.to_owned(), + name.to_string(), + ) + }), + ] + .into_iter() + .flatten() + .collect(), + ) + } } +impl From<&SerializedComponentBatch> for arrow2::datatypes::Field { + #[inline] + fn from(batch: &SerializedComponentBatch) -> Self { + Self::new( + batch.descriptor.component_name.to_string(), + batch.array.data_type().clone().into(), + false, + ) + .with_metadata( + [ + batch.descriptor.archetype_name.map(|name| { + ( + FIELD_METADATA_KEY_ARCHETYPE_NAME.to_owned(), + name.to_string(), + ) + }), + batch.descriptor.archetype_field_name.map(|name| { + ( + FIELD_METADATA_KEY_ARCHETYPE_FIELD_NAME.to_owned(), + name.to_string(), + ) + }), + ] + .into_iter() + .flatten() + .collect(), + ) + } +} + +// --- + // TODO(cmc): All these crazy types are about to disappear. ComponentBatch should only live at the // edge, and therefore not require all these crazy kinds of derivatives (require eager serialization).