From 7c938a62078b68220b9d565fc88d71be66d82ea0 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Tue, 4 Jun 2024 19:13:27 +0200 Subject: [PATCH] remove ToArchetype --- Cargo.lock | 1 - crates/re_entity_db/Cargo.toml | 2 +- crates/re_entity_db/src/entity_db.rs | 44 --- crates/re_query/Cargo.toml | 17 +- .../re_query/examples/latest_at_archetype.rs | 104 ------- crates/re_query/src/latest_at/mod.rs | 3 - crates/re_query/src/latest_at/results.rs | 12 +- .../src/latest_at/to_archetype/.gitattributes | 40 --- .../to_archetype/annotation_context.rs | 51 ---- .../src/latest_at/to_archetype/arrows2d.rs | 121 -------- .../src/latest_at/to_archetype/arrows3d.rs | 121 -------- .../src/latest_at/to_archetype/asset3d.rs | 83 ----- .../src/latest_at/to_archetype/background.rs | 65 ---- .../src/latest_at/to_archetype/bar_chart.rs | 65 ---- .../src/latest_at/to_archetype/boxes2d.rs | 136 --------- .../src/latest_at/to_archetype/boxes3d.rs | 136 --------- .../src/latest_at/to_archetype/clear.rs | 51 ---- .../to_archetype/container_blueprint.rs | 163 ---------- .../src/latest_at/to_archetype/depth_image.rs | 83 ----- .../to_archetype/disconnected_space.rs | 51 ---- .../src/latest_at/to_archetype/image.rs | 65 ---- .../latest_at/to_archetype/line_strips2d.rs | 121 -------- .../latest_at/to_archetype/line_strips3d.rs | 106 ------- .../src/latest_at/to_archetype/mesh3d.rs | 151 --------- .../src/latest_at/to_archetype/mod.rs | 38 --- .../latest_at/to_archetype/panel_blueprint.rs | 49 --- .../src/latest_at/to_archetype/pinhole.rs | 83 ----- .../src/latest_at/to_archetype/plot_legend.rs | 58 ---- .../src/latest_at/to_archetype/points2d.rs | 136 --------- .../src/latest_at/to_archetype/points3d.rs | 121 -------- .../src/latest_at/to_archetype/scalar.rs | 51 ---- .../src/latest_at/to_archetype/scalar_axis.rs | 58 ---- .../to_archetype/segmentation_image.rs | 65 ---- .../src/latest_at/to_archetype/series_line.rs | 72 ----- .../latest_at/to_archetype/series_point.rs | 91 ------ .../to_archetype/space_view_blueprint.rs | 98 ------ .../to_archetype/space_view_contents.rs | 43 --- .../src/latest_at/to_archetype/tensor.rs | 51 ---- .../latest_at/to_archetype/text_document.rs | 65 ---- .../src/latest_at/to_archetype/text_log.rs | 79 ----- .../src/latest_at/to_archetype/transform3d.rs | 51 ---- .../to_archetype/view_coordinates.rs | 51 ---- .../to_archetype/viewport_blueprint.rs | 113 ------- .../to_archetype/visible_time_ranges.rs | 44 --- .../latest_at/to_archetype/visual_bounds2d.rs | 51 ---- crates/re_query/src/lib.rs | 58 ++-- .../re_types_builder/src/codegen/rust/api.rs | 2 - .../re_types_builder/src/codegen/rust/mod.rs | 1 - .../src/codegen/rust/to_archetype.rs | 286 ------------------ .../color_coordinates_visualizer_system.rs | 12 +- 50 files changed, 31 insertions(+), 3588 deletions(-) delete mode 100644 crates/re_query/examples/latest_at_archetype.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/.gitattributes delete mode 100644 crates/re_query/src/latest_at/to_archetype/annotation_context.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/arrows2d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/arrows3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/asset3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/background.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/bar_chart.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/boxes2d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/boxes3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/clear.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/container_blueprint.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/depth_image.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/disconnected_space.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/image.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/line_strips2d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/line_strips3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/mesh3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/mod.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/pinhole.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/plot_legend.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/points2d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/points3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/scalar.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/scalar_axis.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/segmentation_image.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/series_line.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/series_point.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/space_view_blueprint.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/space_view_contents.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/tensor.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/text_document.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/text_log.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/transform3d.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/view_coordinates.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/viewport_blueprint.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs delete mode 100644 crates/re_query/src/latest_at/to_archetype/visual_bounds2d.rs delete mode 100644 crates/re_types_builder/src/codegen/rust/to_archetype.rs diff --git a/Cargo.lock b/Cargo.lock index 0b25eb54d108..cccb06b44f90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4676,7 +4676,6 @@ dependencies = [ "re_tracing", "re_tuid", "re_types", - "re_types_blueprint", "re_types_core", "seq-macro", "similar-asserts", diff --git a/crates/re_entity_db/Cargo.toml b/crates/re_entity_db/Cargo.toml index 5ed1e9829408..14f1d0f77e78 100644 --- a/crates/re_entity_db/Cargo.toml +++ b/crates/re_entity_db/Cargo.toml @@ -34,7 +34,7 @@ re_int_histogram.workspace = true re_log.workspace = true re_log_encoding = { workspace = true, features = ["decoder"] } re_log_types.workspace = true -re_query = { workspace = true, features = ["to_archetype"] } +re_query.workspace = true re_smart_channel.workspace = true re_tracing.workspace = true re_types_core.workspace = true diff --git a/crates/re_entity_db/src/entity_db.rs b/crates/re_entity_db/src/entity_db.rs index 8fdbc7551562..77aeef08bb56 100644 --- a/crates/re_entity_db/src/entity_db.rs +++ b/crates/re_entity_db/src/entity_db.rs @@ -12,7 +12,6 @@ use re_log_types::{ EntityPathHash, LogMsg, ResolvedTimeRange, ResolvedTimeRangeF, RowId, SetStoreInfo, StoreId, StoreInfo, StoreKind, TimePoint, Timeline, }; -use re_query::PromiseResult; use re_types_core::{Archetype, Loggable}; use crate::{ClearCascade, CompactedStoreEvents, Error, TimesPerTimeline}; @@ -198,49 +197,6 @@ impl EntityDb { &self.resolver } - /// Returns `Ok(None)` if any of the required components are missing. - #[inline] - pub fn latest_at_archetype( - &self, - entity_path: &EntityPath, - query: &re_data_store::LatestAtQuery, - ) -> PromiseResult> - where - re_query::LatestAtResults: re_query::ToArchetype, - { - let results = self.query_caches().latest_at( - self.store(), - query, - entity_path, - A::all_components().iter().copied(), // no generics! - ); - - use re_query::ToArchetype as _; - match results.to_archetype(self.resolver()).flatten() { - PromiseResult::Pending => PromiseResult::Pending, - PromiseResult::Error(err) => { - // Primary component has never been logged. - if let Some(err) = err.downcast_ref::() { - if matches!(err, re_query::QueryError::PrimaryNotFound(_)) { - return PromiseResult::Ready(None); - } - } - - // Primary component has been cleared. - if let Some(err) = err.downcast_ref::() { - if matches!(err, re_types_core::DeserializationError::MissingData { .. }) { - return PromiseResult::Ready(None); - } - } - - PromiseResult::Error(err) - } - PromiseResult::Ready(arch) => { - PromiseResult::Ready(Some((results.compound_index, arch))) - } - } - } - /// Queries for the given `component_names` using latest-at semantics. /// /// See [`re_query::LatestAtResults`] for more information about how to handle the results. diff --git a/crates/re_query/Cargo.toml b/crates/re_query/Cargo.toml index df13a22fe1e4..ccaf5dfbb0de 100644 --- a/crates/re_query/Cargo.toml +++ b/crates/re_query/Cargo.toml @@ -20,10 +20,7 @@ all-features = true [features] -default = ["to_archetype"] - -## Implements `ToArchetype` for all builtin archetypes on `LatestAtResults`. -to_archetype = ["dep:re_types", "dep:re_types_blueprint"] +default = [] ## Enable codegen helper binaries (generates ClampedZip & RangeZip implementations). codegen = [] @@ -40,10 +37,6 @@ re_tracing.workspace = true re_tuid.workspace = true re_types_core.workspace = true -# Rerun dependencies (optional): -re_types = { workspace = true, optional = true } -re_types_blueprint = { workspace = true, optional = true } - # External dependencies: ahash.workspace = true anyhow.workspace = true @@ -64,18 +57,12 @@ thiserror.workspace = true criterion.workspace = true mimalloc.workspace = true rand = { workspace = true, features = ["std", "std_rng"] } +re_types.workspace = true similar-asserts.workspace = true - [lib] bench = false - -[[example]] -name = "latest_at_archetype" -required-features = ["to_archetype"] - - [[bin]] name = "clamped_zip" required-features = ["codegen"] diff --git a/crates/re_query/examples/latest_at_archetype.rs b/crates/re_query/examples/latest_at_archetype.rs deleted file mode 100644 index c351333c86e7..000000000000 --- a/crates/re_query/examples/latest_at_archetype.rs +++ /dev/null @@ -1,104 +0,0 @@ -use itertools::Itertools; -use re_data_store::{DataStore, LatestAtQuery}; -use re_log_types::{build_frame_nr, DataRow, RowId, TimeType, Timeline}; -use re_types::{ - archetypes::Points2D, - components::{Color, Position2D, Text}, -}; -use re_types_core::Archetype as _; - -use re_query::{clamped_zip_1x2, LatestAtResults, PromiseResolver, PromiseResult}; - -// --- - -fn main() -> anyhow::Result<()> { - let store = store()?; - eprintln!("store:\n{}", store.to_data_table()?); - - let resolver = PromiseResolver::default(); - - let entity_path = "points"; - let timeline = Timeline::new("frame_nr", TimeType::Sequence); - let query = LatestAtQuery::latest(timeline); - eprintln!("query:{query:?}"); - - let caches = re_query::Caches::new(&store); - - // First, get the results for this query. - // - // They might or might not already be cached. We won't know for sure until we try to access - // each individual component's data below. - let results: LatestAtResults = caches.latest_at( - &store, - &query, - &entity_path.into(), - Points2D::all_components().iter().copied(), // no generics! - ); - - // Then make use of the `ToArchetype` helper trait in order to query, resolve, deserialize and - // cache an entire archetype all at once. - use re_query::ToArchetype as _; - - let arch: Points2D = match results.to_archetype(&resolver).flatten() { - PromiseResult::Pending => { - // Handle the fact that the data isn't ready appropriately. - return Ok(()); - } - PromiseResult::Ready(arch) => arch, - PromiseResult::Error(err) => return Err(err.into()), - }; - - // With the data now fully resolved/converted and deserialized, some joining logic can be - // applied if desired. - // - // In most cases this will be either a clamped zip, or no joining at all. - - let color_default_fn = || None; - let label_default_fn = || None; - - let results = clamped_zip_1x2( - arch.positions.iter(), - arch.colors - .iter() - .flat_map(|colors| colors.iter().map(Some)), - color_default_fn, - arch.labels - .iter() - .flat_map(|labels| labels.iter().map(Some)), - label_default_fn, - ) - .collect_vec(); - - eprintln!("results:\n{results:?}"); - - Ok(()) -} - -// --- - -fn store() -> anyhow::Result { - let mut store = DataStore::new( - re_log_types::StoreId::random(re_log_types::StoreKind::Recording), - Default::default(), - ); - - let entity_path = "points"; - - { - let timepoint = [build_frame_nr(123)]; - - let points = vec![Position2D::new(1.0, 2.0), Position2D::new(3.0, 4.0)]; - let row = DataRow::from_cells1_sized(RowId::new(), entity_path, timepoint, points)?; - store.insert_row(&row)?; - - let colors = vec![Color::from_rgb(255, 0, 0)]; - let row = DataRow::from_cells1_sized(RowId::new(), entity_path, timepoint, colors)?; - store.insert_row(&row)?; - - let labels = vec![Text("a".into()), Text("b".into())]; - let row = DataRow::from_cells1_sized(RowId::new(), entity_path, timepoint, labels)?; - store.insert_row(&row)?; - } - - Ok(store) -} diff --git a/crates/re_query/src/latest_at/mod.rs b/crates/re_query/src/latest_at/mod.rs index 04511f831260..b99f9ad6922b 100644 --- a/crates/re_query/src/latest_at/mod.rs +++ b/crates/re_query/src/latest_at/mod.rs @@ -2,9 +2,6 @@ mod helpers; mod query; mod results; -#[cfg(feature = "to_archetype")] -mod to_archetype; - pub use self::helpers::LatestAtMonoResult; pub use self::query::LatestAtCache; pub use self::results::{LatestAtComponentResults, LatestAtResults}; diff --git a/crates/re_query/src/latest_at/results.rs b/crates/re_query/src/latest_at/results.rs index c115ee812253..edca11466af9 100644 --- a/crates/re_query/src/latest_at/results.rs +++ b/crates/re_query/src/latest_at/results.rs @@ -91,7 +91,7 @@ impl LatestAtResults { } /// Utility for retrieving a single instance of a component. - pub fn get_instance( + pub fn get_instance( &self, resolver: &PromiseResolver, index: usize, @@ -101,11 +101,17 @@ impl LatestAtResults { } /// Utility for retrieving a specific component. - pub fn get_slice(&self, resolver: &PromiseResolver) -> Option<&[T]> { + pub fn get_slice( + &self, + resolver: &PromiseResolver, + ) -> Option<&[T]> { self.get(T::name()).and_then(|r| r.dense::(resolver)) } - pub fn get_vec(&self, resolver: &PromiseResolver) -> Option> { + pub fn get_vec( + &self, + resolver: &PromiseResolver, + ) -> Option> { self.get_slice(resolver).map(|v| v.to_vec()) } } diff --git a/crates/re_query/src/latest_at/to_archetype/.gitattributes b/crates/re_query/src/latest_at/to_archetype/.gitattributes deleted file mode 100644 index 543824a5a825..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/.gitattributes +++ /dev/null @@ -1,40 +0,0 @@ -# DO NOT EDIT! This file is generated by crates/re_types_builder/src/lib.rs - -.gitattributes linguist-generated=true -annotation_context.rs linguist-generated=true -arrows2d.rs linguist-generated=true -arrows3d.rs linguist-generated=true -asset3d.rs linguist-generated=true -background.rs linguist-generated=true -bar_chart.rs linguist-generated=true -boxes2d.rs linguist-generated=true -boxes3d.rs linguist-generated=true -clear.rs linguist-generated=true -container_blueprint.rs linguist-generated=true -depth_image.rs linguist-generated=true -disconnected_space.rs linguist-generated=true -image.rs linguist-generated=true -line_strips2d.rs linguist-generated=true -line_strips3d.rs linguist-generated=true -mesh3d.rs linguist-generated=true -mod.rs linguist-generated=true -panel_blueprint.rs linguist-generated=true -pinhole.rs linguist-generated=true -plot_legend.rs linguist-generated=true -points2d.rs linguist-generated=true -points3d.rs linguist-generated=true -scalar.rs linguist-generated=true -scalar_axis.rs linguist-generated=true -segmentation_image.rs linguist-generated=true -series_line.rs linguist-generated=true -series_point.rs linguist-generated=true -space_view_blueprint.rs linguist-generated=true -space_view_contents.rs linguist-generated=true -tensor.rs linguist-generated=true -text_document.rs linguist-generated=true -text_log.rs linguist-generated=true -transform3d.rs linguist-generated=true -view_coordinates.rs linguist-generated=true -viewport_blueprint.rs linguist-generated=true -visible_time_ranges.rs linguist-generated=true -visual_bounds2d.rs linguist-generated=true diff --git a/crates/re_query/src/latest_at/to_archetype/annotation_context.rs b/crates/re_query/src/latest_at/to_archetype/annotation_context.rs deleted file mode 100644 index 8afa32ea8561..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/annotation_context.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::AnnotationContext; - let context = match self.get_required(::name()) { - Ok(context) => context, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let context = match context.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::archetypes::AnnotationContext { context }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/arrows2d.rs b/crates/re_query/src/latest_at/to_archetype/arrows2d.rs deleted file mode 100644 index 5adc4153fe65..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/arrows2d.rs +++ /dev/null @@ -1,121 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Vector2D; - let vectors = match self.get_required(::name()) { - Ok(vectors) => vectors, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let vectors = match vectors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Position2D; - let origins = if let Some(origins) = self.get(::name()) { - match origins.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Arrows2D { - vectors, - origins, - radii, - colors, - labels, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/arrows3d.rs b/crates/re_query/src/latest_at/to_archetype/arrows3d.rs deleted file mode 100644 index fe4bd99f06c5..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/arrows3d.rs +++ /dev/null @@ -1,121 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Vector3D; - let vectors = match self.get_required(::name()) { - Ok(vectors) => vectors, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let vectors = match vectors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Position3D; - let origins = if let Some(origins) = self.get(::name()) { - match origins.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Arrows3D { - vectors, - origins, - radii, - colors, - labels, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/asset3d.rs b/crates/re_query/src/latest_at/to_archetype/asset3d.rs deleted file mode 100644 index 03931257d1ce..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/asset3d.rs +++ /dev/null @@ -1,83 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Blob; - let blob = match self.get_required(::name()) { - Ok(blob) => blob, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let blob = match blob.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::MediaType; - let media_type = if let Some(media_type) = self.get(::name()) { - match media_type.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::OutOfTreeTransform3D; - let transform = if let Some(transform) = self.get(::name()) { - match transform.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Asset3D { - blob, - media_type, - transform, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/background.rs b/crates/re_query/src/latest_at/to_archetype/background.rs deleted file mode 100644 index 319228ffb294..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/background.rs +++ /dev/null @@ -1,65 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::blueprint::components::BackgroundKind; - let kind = match self.get_required(::name()) { - Ok(kind) => kind, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let kind = match kind.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Color; - let color = if let Some(color) = self.get(::name()) { - match color.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::blueprint::archetypes::Background { kind, color }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/bar_chart.rs b/crates/re_query/src/latest_at/to_archetype/bar_chart.rs deleted file mode 100644 index 7a71bf148d3d..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/bar_chart.rs +++ /dev/null @@ -1,65 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::TensorData; - let values = match self.get_required(::name()) { - Ok(values) => values, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let values = match values.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Color; - let color = if let Some(color) = self.get(::name()) { - match color.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::BarChart { values, color }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/boxes2d.rs b/crates/re_query/src/latest_at/to_archetype/boxes2d.rs deleted file mode 100644 index dd6aeb26070f..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/boxes2d.rs +++ /dev/null @@ -1,136 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::HalfSizes2D; - let half_sizes = match self.get_required(::name()) { - Ok(half_sizes) => half_sizes, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let half_sizes = match half_sizes.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Position2D; - let centers = if let Some(centers) = self.get(::name()) { - match centers.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::DrawOrder; - let draw_order = if let Some(draw_order) = self.get(::name()) { - match draw_order.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Boxes2D { - half_sizes, - centers, - colors, - radii, - labels, - draw_order, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/boxes3d.rs b/crates/re_query/src/latest_at/to_archetype/boxes3d.rs deleted file mode 100644 index c0790e887012..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/boxes3d.rs +++ /dev/null @@ -1,136 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::HalfSizes3D; - let half_sizes = match self.get_required(::name()) { - Ok(half_sizes) => half_sizes, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let half_sizes = match half_sizes.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Position3D; - let centers = if let Some(centers) = self.get(::name()) { - match centers.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Rotation3D; - let rotations = if let Some(rotations) = self.get(::name()) { - match rotations.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Boxes3D { - half_sizes, - centers, - rotations, - colors, - radii, - labels, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/clear.rs b/crates/re_query/src/latest_at/to_archetype/clear.rs deleted file mode 100644 index 6d4c8f01e4b3..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/clear.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types_core::components::ClearIsRecursive; - let is_recursive = match self.get_required(::name()) { - Ok(is_recursive) => is_recursive, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let is_recursive = match is_recursive.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types_core::archetypes::Clear { is_recursive }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/container_blueprint.rs b/crates/re_query/src/latest_at/to_archetype/container_blueprint.rs deleted file mode 100644 index d6db455e1e7f..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/container_blueprint.rs +++ /dev/null @@ -1,163 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype - for LatestAtResults -{ - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> - { - re_tracing::profile_function!( - ::name() - ); - - // --- Required --- - - use re_types_blueprint::blueprint::components::ContainerKind; - let container_kind = match self.get_required(::name()) { - Ok(container_kind) => container_kind, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let container_kind = match container_kind.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Name; - let display_name = if let Some(display_name) = self.get(::name()) { - match display_name.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::IncludedContent; - let contents = if let Some(contents) = self.get(::name()) { - match contents.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::ColumnShare; - let col_shares = if let Some(col_shares) = self.get(::name()) { - match col_shares.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::RowShare; - let row_shares = if let Some(row_shares) = self.get(::name()) { - match row_shares.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::ActiveTab; - let active_tab = if let Some(active_tab) = self.get(::name()) { - match active_tab.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::Visible; - let visible = if let Some(visible) = self.get(::name()) { - match visible.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types_blueprint::blueprint::components::GridColumns; - let grid_columns = if let Some(grid_columns) = self.get(::name()) { - match grid_columns.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types_blueprint::blueprint::archetypes::ContainerBlueprint { - container_kind, - display_name, - contents, - col_shares, - row_shares, - active_tab, - visible, - grid_columns, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/depth_image.rs b/crates/re_query/src/latest_at/to_archetype/depth_image.rs deleted file mode 100644 index 802da9f44971..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/depth_image.rs +++ /dev/null @@ -1,83 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::TensorData; - let data = match self.get_required(::name()) { - Ok(data) => data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let data = match data.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::DepthMeter; - let meter = if let Some(meter) = self.get(::name()) { - match meter.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::DrawOrder; - let draw_order = if let Some(draw_order) = self.get(::name()) { - match draw_order.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::DepthImage { - data, - meter, - draw_order, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/disconnected_space.rs b/crates/re_query/src/latest_at/to_archetype/disconnected_space.rs deleted file mode 100644 index e409fcd63194..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/disconnected_space.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::DisconnectedSpace; - let disconnected_space = match self.get_required(::name()) { - Ok(disconnected_space) => disconnected_space, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let disconnected_space = match disconnected_space.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::archetypes::DisconnectedSpace { disconnected_space }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/image.rs b/crates/re_query/src/latest_at/to_archetype/image.rs deleted file mode 100644 index ddf966610409..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/image.rs +++ /dev/null @@ -1,65 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::TensorData; - let data = match self.get_required(::name()) { - Ok(data) => data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let data = match data.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::DrawOrder; - let draw_order = if let Some(draw_order) = self.get(::name()) { - match draw_order.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Image { data, draw_order }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/line_strips2d.rs b/crates/re_query/src/latest_at/to_archetype/line_strips2d.rs deleted file mode 100644 index b51624b9ab28..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/line_strips2d.rs +++ /dev/null @@ -1,121 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::LineStrip2D; - let strips = match self.get_required(::name()) { - Ok(strips) => strips, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let strips = match strips.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::DrawOrder; - let draw_order = if let Some(draw_order) = self.get(::name()) { - match draw_order.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::LineStrips2D { - strips, - radii, - colors, - labels, - draw_order, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/line_strips3d.rs b/crates/re_query/src/latest_at/to_archetype/line_strips3d.rs deleted file mode 100644 index a11a49c0eebd..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/line_strips3d.rs +++ /dev/null @@ -1,106 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::LineStrip3D; - let strips = match self.get_required(::name()) { - Ok(strips) => strips, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let strips = match strips.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::LineStrips3D { - strips, - radii, - colors, - labels, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/mesh3d.rs b/crates/re_query/src/latest_at/to_archetype/mesh3d.rs deleted file mode 100644 index 030dde884e7a..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/mesh3d.rs +++ /dev/null @@ -1,151 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Position3D; - let vertex_positions = match self.get_required(::name()) { - Ok(vertex_positions) => vertex_positions, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let vertex_positions = match vertex_positions.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::TriangleIndices; - let triangle_indices = if let Some(triangle_indices) = self.get(::name()) { - match triangle_indices.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Vector3D; - let vertex_normals = if let Some(vertex_normals) = self.get(::name()) { - match vertex_normals.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let vertex_colors = if let Some(vertex_colors) = self.get(::name()) { - match vertex_colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Texcoord2D; - let vertex_texcoords = if let Some(vertex_texcoords) = self.get(::name()) { - match vertex_texcoords.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Material; - let mesh_material = if let Some(mesh_material) = self.get(::name()) { - match mesh_material.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::TensorData; - let albedo_texture = if let Some(albedo_texture) = self.get(::name()) { - match albedo_texture.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Mesh3D { - vertex_positions, - triangle_indices, - vertex_normals, - vertex_colors, - vertex_texcoords, - mesh_material, - albedo_texture, - class_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/mod.rs b/crates/re_query/src/latest_at/to_archetype/mod.rs deleted file mode 100644 index 6348f1adce28..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/mod.rs +++ /dev/null @@ -1,38 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -mod annotation_context; -mod arrows2d; -mod arrows3d; -mod asset3d; -mod background; -mod bar_chart; -mod boxes2d; -mod boxes3d; -mod clear; -mod container_blueprint; -mod depth_image; -mod disconnected_space; -mod image; -mod line_strips2d; -mod line_strips3d; -mod mesh3d; -mod panel_blueprint; -mod pinhole; -mod plot_legend; -mod points2d; -mod points3d; -mod scalar; -mod scalar_axis; -mod segmentation_image; -mod series_line; -mod series_point; -mod space_view_blueprint; -mod space_view_contents; -mod tensor; -mod text_document; -mod text_log; -mod transform3d; -mod view_coordinates; -mod viewport_blueprint; -mod visible_time_ranges; -mod visual_bounds2d; diff --git a/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs b/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs deleted file mode 100644 index 7e9a0fea77af..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs +++ /dev/null @@ -1,49 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype - for LatestAtResults -{ - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> - { - re_tracing::profile_function!( - ::name() - ); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types::blueprint::components::PanelState; - let state = if let Some(state) = self.get(::name()) { - match state.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types_blueprint::blueprint::archetypes::PanelBlueprint { state }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/pinhole.rs b/crates/re_query/src/latest_at/to_archetype/pinhole.rs deleted file mode 100644 index 34419beb7435..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/pinhole.rs +++ /dev/null @@ -1,83 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::PinholeProjection; - let image_from_camera = match self.get_required(::name()) { - Ok(image_from_camera) => image_from_camera, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let image_from_camera = match image_from_camera.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Resolution; - let resolution = if let Some(resolution) = self.get(::name()) { - match resolution.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ViewCoordinates; - let camera_xyz = if let Some(camera_xyz) = self.get(::name()) { - match camera_xyz.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Pinhole { - image_from_camera, - resolution, - camera_xyz, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/plot_legend.rs b/crates/re_query/src/latest_at/to_archetype/plot_legend.rs deleted file mode 100644 index b5d466095cc1..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/plot_legend.rs +++ /dev/null @@ -1,58 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types::blueprint::components::Corner2D; - let corner = if let Some(corner) = self.get(::name()) { - match corner.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::Visible; - let visible = if let Some(visible) = self.get(::name()) { - match visible.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::blueprint::archetypes::PlotLegend { corner, visible }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/points2d.rs b/crates/re_query/src/latest_at/to_archetype/points2d.rs deleted file mode 100644 index 9fd2be9a01f1..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/points2d.rs +++ /dev/null @@ -1,136 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Position2D; - let positions = match self.get_required(::name()) { - Ok(positions) => positions, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let positions = match positions.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::DrawOrder; - let draw_order = if let Some(draw_order) = self.get(::name()) { - match draw_order.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::KeypointId; - let keypoint_ids = if let Some(keypoint_ids) = self.get(::name()) { - match keypoint_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Points2D { - positions, - radii, - colors, - labels, - draw_order, - class_ids, - keypoint_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/points3d.rs b/crates/re_query/src/latest_at/to_archetype/points3d.rs deleted file mode 100644 index 2525c7ca81bf..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/points3d.rs +++ /dev/null @@ -1,121 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Position3D; - let positions = match self.get_required(::name()) { - Ok(positions) => positions, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let positions = match positions.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Radius; - let radii = if let Some(radii) = self.get(::name()) { - match radii.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let colors = if let Some(colors) = self.get(::name()) { - match colors.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Text; - let labels = if let Some(labels) = self.get(::name()) { - match labels.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::ClassId; - let class_ids = if let Some(class_ids) = self.get(::name()) { - match class_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::KeypointId; - let keypoint_ids = if let Some(keypoint_ids) = self.get(::name()) { - match keypoint_ids.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::Points3D { - positions, - radii, - colors, - labels, - class_ids, - keypoint_ids, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/scalar.rs b/crates/re_query/src/latest_at/to_archetype/scalar.rs deleted file mode 100644 index 3f715f0bba97..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/scalar.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Scalar; - let scalar = match self.get_required(::name()) { - Ok(scalar) => scalar, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let scalar = match scalar.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::archetypes::Scalar { scalar }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/scalar_axis.rs b/crates/re_query/src/latest_at/to_archetype/scalar_axis.rs deleted file mode 100644 index cecb59d47982..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/scalar_axis.rs +++ /dev/null @@ -1,58 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types::components::Range1D; - let range = if let Some(range) = self.get(::name()) { - match range.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::LockRangeDuringZoom; - let zoom_lock = if let Some(zoom_lock) = self.get(::name()) { - match zoom_lock.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::blueprint::archetypes::ScalarAxis { range, zoom_lock }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/segmentation_image.rs b/crates/re_query/src/latest_at/to_archetype/segmentation_image.rs deleted file mode 100644 index 203ca4f697b3..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/segmentation_image.rs +++ /dev/null @@ -1,65 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::TensorData; - let data = match self.get_required(::name()) { - Ok(data) => data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let data = match data.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::DrawOrder; - let draw_order = if let Some(draw_order) = self.get(::name()) { - match draw_order.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::SegmentationImage { data, draw_order }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/series_line.rs b/crates/re_query/src/latest_at/to_archetype/series_line.rs deleted file mode 100644 index 88895798d555..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/series_line.rs +++ /dev/null @@ -1,72 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types::components::Color; - let color = if let Some(color) = self.get(::name()) { - match color.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::StrokeWidth; - let width = if let Some(width) = self.get(::name()) { - match width.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Name; - let name = if let Some(name) = self.get(::name()) { - match name.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::SeriesLine { color, width, name }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/series_point.rs b/crates/re_query/src/latest_at/to_archetype/series_point.rs deleted file mode 100644 index 273aca5ac53a..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/series_point.rs +++ /dev/null @@ -1,91 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types::components::Color; - let color = if let Some(color) = self.get(::name()) { - match color.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::MarkerShape; - let marker = if let Some(marker) = self.get(::name()) { - match marker.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Name; - let name = if let Some(name) = self.get(::name()) { - match name.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::MarkerSize; - let marker_size = if let Some(marker_size) = self.get(::name()) { - match marker_size.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::SeriesPoint { - color, - marker, - name, - marker_size, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/space_view_blueprint.rs b/crates/re_query/src/latest_at/to_archetype/space_view_blueprint.rs deleted file mode 100644 index f4e94c1a4c16..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/space_view_blueprint.rs +++ /dev/null @@ -1,98 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::blueprint::components::SpaceViewClass; - let class_identifier = match self.get_required(::name()) { - Ok(class_identifier) => class_identifier, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let class_identifier = match class_identifier.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::Name; - let display_name = if let Some(display_name) = self.get(::name()) { - match display_name.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::SpaceViewOrigin; - let space_origin = if let Some(space_origin) = self.get(::name()) { - match space_origin.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::Visible; - let visible = if let Some(visible) = self.get(::name()) { - match visible.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::blueprint::archetypes::SpaceViewBlueprint { - class_identifier, - display_name, - space_origin, - visible, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/space_view_contents.rs b/crates/re_query/src/latest_at/to_archetype/space_view_contents.rs deleted file mode 100644 index b35439f90369..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/space_view_contents.rs +++ /dev/null @@ -1,43 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types::blueprint::components::QueryExpression; - let query = match self - .get_or_empty(::name()) - .to_dense::(resolver) - { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- - - let arch = re_types::blueprint::archetypes::SpaceViewContents { query }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/tensor.rs b/crates/re_query/src/latest_at/to_archetype/tensor.rs deleted file mode 100644 index 2b72bef07906..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/tensor.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::TensorData; - let data = match self.get_required(::name()) { - Ok(data) => data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let data = match data.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::archetypes::Tensor { data }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/text_document.rs b/crates/re_query/src/latest_at/to_archetype/text_document.rs deleted file mode 100644 index 9d4061fff7a9..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/text_document.rs +++ /dev/null @@ -1,65 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Text; - let text = match self.get_required(::name()) { - Ok(text) => text, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let text = match text.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::MediaType; - let media_type = if let Some(media_type) = self.get(::name()) { - match media_type.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::TextDocument { text, media_type }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/text_log.rs b/crates/re_query/src/latest_at/to_archetype/text_log.rs deleted file mode 100644 index 4cddf9829b23..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/text_log.rs +++ /dev/null @@ -1,79 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Text; - let text = match self.get_required(::name()) { - Ok(text) => text, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let text = match text.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - use re_types::components::TextLogLevel; - let level = if let Some(level) = self.get(::name()) { - match level.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::components::Color; - let color = if let Some(color) = self.get(::name()) { - match color.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types::archetypes::TextLog { text, level, color }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/transform3d.rs b/crates/re_query/src/latest_at/to_archetype/transform3d.rs deleted file mode 100644 index 7f7a1d96a383..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/transform3d.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::Transform3D; - let transform = match self.get_required(::name()) { - Ok(transform) => transform, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let transform = match transform.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::archetypes::Transform3D { transform }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/view_coordinates.rs b/crates/re_query/src/latest_at/to_archetype/view_coordinates.rs deleted file mode 100644 index 2abff463bb7f..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/view_coordinates.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::components::ViewCoordinates; - let xyz = match self.get_required(::name()) { - Ok(xyz) => xyz, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let xyz = match xyz.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::archetypes::ViewCoordinates { xyz }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/viewport_blueprint.rs b/crates/re_query/src/latest_at/to_archetype/viewport_blueprint.rs deleted file mode 100644 index e5c19cca9fac..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/viewport_blueprint.rs +++ /dev/null @@ -1,113 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype - for LatestAtResults -{ - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> - { - re_tracing::profile_function!( - ::name() - ); - - // --- Required --- - - // --- Recommended/Optional --- - - use re_types_blueprint::blueprint::components::RootContainer; - let root_container = if let Some(root_container) = self.get(::name()) { - match root_container.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types_blueprint::blueprint::components::SpaceViewMaximized; - let maximized = if let Some(maximized) = self.get(::name()) { - match maximized.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types_blueprint::blueprint::components::AutoLayout; - let auto_layout = if let Some(auto_layout) = self.get(::name()) { - match auto_layout.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types_blueprint::blueprint::components::AutoSpaceViews; - let auto_space_views = if let Some(auto_space_views) = self.get(::name()) { - match auto_space_views.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.first().cloned(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - use re_types::blueprint::components::ViewerRecommendationHash; - let past_viewer_recommendations = if let Some(past_viewer_recommendations) = - self.get(::name()) - { - match past_viewer_recommendations.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => Some(data.to_vec()), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - - // --- - - let arch = re_types_blueprint::blueprint::archetypes::ViewportBlueprint { - root_container, - maximized, - auto_layout, - auto_space_views, - past_viewer_recommendations, - }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs b/crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs deleted file mode 100644 index fad43a183504..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/visible_time_ranges.rs +++ /dev/null @@ -1,44 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::blueprint::components::VisibleTimeRange; - let ranges = match self.get_required(::name()) { - Ok(ranges) => ranges, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let ranges = match ranges.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => data.to_vec(), - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::blueprint::archetypes::VisibleTimeRanges { ranges }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/latest_at/to_archetype/visual_bounds2d.rs b/crates/re_query/src/latest_at/to_archetype/visual_bounds2d.rs deleted file mode 100644 index 82a16d8ecfea..000000000000 --- a/crates/re_query/src/latest_at/to_archetype/visual_bounds2d.rs +++ /dev/null @@ -1,51 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/rust/to_archetype.rs - -#![allow(unused_imports)] -#![allow(unused_parens)] -#![allow(clippy::clone_on_copy)] -#![allow(clippy::cloned_instead_of_copied)] - -use crate::{LatestAtResults, PromiseResolver, PromiseResult}; -use re_types_core::{Archetype, Loggable as _}; -use std::sync::Arc; - -impl crate::ToArchetype for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - re_tracing::profile_function!(::name()); - - // --- Required --- - - use re_types::blueprint::components::VisualBounds2D; - let range = match self.get_required(::name()) { - Ok(range) => range, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let range = match range.to_dense::(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => { - let Some(first) = data.first().cloned() else { - return PromiseResult::Error(std::sync::Arc::new( - re_types_core::DeserializationError::missing_data(), - )); - }; - first - } - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - - // --- Recommended/Optional --- - - // --- - - let arch = re_types::blueprint::archetypes::VisualBounds2D { range }; - - PromiseResult::Ready(Ok(arch)) - } -} diff --git a/crates/re_query/src/lib.rs b/crates/re_query/src/lib.rs index f9455c39ed8d..a4bc0cc07db2 100644 --- a/crates/re_query/src/lib.rs +++ b/crates/re_query/src/lib.rs @@ -83,20 +83,6 @@ pub type Result = std::result::Result; // --- -/// Helper extension trait to convert query results into [`re_types_core::Archetype`]s. -pub trait ToArchetype { - /// Converts the result into an [`re_types_core::Archetype`]. - /// - /// Automatically handles all aspects of the query process: deserialization, caching, promise - /// resolution, etc. - fn to_archetype( - &self, - resolver: &crate::PromiseResolver, - ) -> crate::PromiseResult>; -} - -// --- - use re_data_store::{LatestAtQuery, RangeQuery}; #[derive(Debug)] @@ -129,32 +115,8 @@ pub fn cacheable(component_name: re_types_core::ComponentName) -> bool { use std::sync::OnceLock; static NOT_CACHEABLE: OnceLock = OnceLock::new(); - #[cfg(feature = "to_archetype")] - let component_names = { - // Make sure to break if these names change, so people know to update the fallback path below. - #[cfg(debug_assertions)] - { - assert_eq!( - re_types::components::TensorData::name(), - "rerun.components.TensorData" - ); - assert_eq!(re_types::components::Blob::name(), "rerun.components.Blob"); - } - - use re_types_core::Loggable as _; - [ - // TODO(#5974): tensors might already be cached in the ad-hoc JPEG cache, we don't - // want yet another copy. - re_types::components::TensorData::name(), - // TODO(#5974): blobs are used for assets, which are themselves already cached in - // the ad-hoc mesh cache -- we don't want yet another copy. - re_types::components::Blob::name(), - ] - }; - - // Horrible hack so we can still make this work when features are disabled. - // Not great, but this all a hack anyhow. - #[cfg(not(feature = "to_archetype"))] + // Horrible hack so we can make this work without depending on re_types. + // We have a dev dependency on re_types only, so we test this in the tests below against the "symbolic" names. let component_names = [ "rerun.components.TensorData".into(), "rerun.components.Blob".into(), @@ -164,3 +126,19 @@ pub fn cacheable(component_name: re_types_core::ComponentName) -> bool { !component_name.is_indicator_component() && !not_cacheable.contains(&component_name) } + +#[cfg(test)] +mod tests { + use re_types::{ + components::{Blob, TensorData}, + Loggable as _, + }; + + use super::*; + + #[test] + fn test_cacheable() { + assert!(!cacheable(TensorData::name())); + assert!(!cacheable(Blob::name())); + } +} diff --git a/crates/re_types_builder/src/codegen/rust/api.rs b/crates/re_types_builder/src/codegen/rust/api.rs index 766624bd66d8..7aa7e1ce0bd2 100644 --- a/crates/re_types_builder/src/codegen/rust/api.rs +++ b/crates/re_types_builder/src/codegen/rust/api.rs @@ -33,7 +33,6 @@ use crate::{ use super::{ arrow::quote_fqname_as_type_path, blueprint_validation::generate_blueprint_validation, - to_archetype::generate_to_archetype_impls, util::{string_from_quoted, SIMPLE_COMMENT_PREFIX}, }; @@ -71,7 +70,6 @@ impl CodeGenerator for RustCodeGenerator { generate_component_defaults(reporter, objects, &mut files_to_write); generate_blueprint_validation(reporter, objects, &mut files_to_write); - generate_to_archetype_impls(reporter, objects, &mut files_to_write); files_to_write } diff --git a/crates/re_types_builder/src/codegen/rust/mod.rs b/crates/re_types_builder/src/codegen/rust/mod.rs index 33a12cf821d7..6179dffcc5dc 100644 --- a/crates/re_types_builder/src/codegen/rust/mod.rs +++ b/crates/re_types_builder/src/codegen/rust/mod.rs @@ -5,7 +5,6 @@ mod arrow; mod blueprint_validation; mod deserializer; mod serializer; -mod to_archetype; mod util; pub use self::api::RustCodeGenerator; diff --git a/crates/re_types_builder/src/codegen/rust/to_archetype.rs b/crates/re_types_builder/src/codegen/rust/to_archetype.rs deleted file mode 100644 index af38e603a5d8..000000000000 --- a/crates/re_types_builder/src/codegen/rust/to_archetype.rs +++ /dev/null @@ -1,286 +0,0 @@ -//! Generates code in `re_query` so that cached results can easily be converted to -//! ready-to-use archetypes. -//! -//! That code needs to be generated directly in the caching crates as it needs access to the cached -//! queries and results as well as the promise resolving machinery. -//! Generating such code in the usual places would result in one giant cycle dependency chain. - -use std::collections::BTreeMap; - -use camino::Utf8PathBuf; -use proc_macro2::TokenStream; -use quote::{format_ident, quote}; - -use crate::{objects::FieldKind, Object, ObjectKind, Objects, Reporter}; - -// --- - -const NEWLINE_TOKEN: &str = "NEWLINE_TOKEN"; -const COMMENT_SEPARATOR_TOKEN: &str = "COMMENT_SEPARATOR_TOKEN"; -const COMMENT_REQUIRED_TOKEN: &str = "COMMENT_REQUIRED_TOKEN"; -const COMMENT_RECOMMENDED_OPTIONAL_TOKEN: &str = "COMMENT_RECOMMENDED_OPTIONAL_TOKEN"; - -pub fn generate_to_archetype_impls( - reporter: &Reporter, - objects: &Objects, - files_to_write: &mut BTreeMap, -) { - generate_mod(reporter, objects, files_to_write); - generate_impls(reporter, objects, files_to_write); -} - -fn generate_mod( - _reporter: &Reporter, - objects: &Objects, - files_to_write: &mut BTreeMap, -) { - let generated_path = Utf8PathBuf::from("crates/re_query/src/latest_at/to_archetype/mod.rs"); - - let mut code = String::new(); - code.push_str(&format!("// {}\n\n", crate::codegen::autogen_warning!())); - - let mut mods = Vec::new(); - - for obj in objects.ordered_objects(Some(ObjectKind::Archetype)) { - // TODO(#4478): add a 'testing' scope - if obj.fqname.contains("testing") { - continue; - } - - let arch_name = obj.snake_case_name(); - mods.push(format!("mod {arch_name};")); - } - - code.push_str(&mods.join("\n")); - - files_to_write.insert(generated_path, code); -} - -fn generate_impls( - _reporter: &Reporter, - objects: &Objects, - files_to_write: &mut BTreeMap, -) { - let generated_path = Utf8PathBuf::from("crates/re_query/src/latest_at/to_archetype"); - - let quoted_imports = quote! { - use std::sync::Arc; - - use re_types_core::{Archetype, Loggable as _}; - - use crate::{LatestAtResults, PromiseResolver, PromiseResult}; - }; - - for obj in objects.ordered_objects(Some(ObjectKind::Archetype)) { - if obj - .try_get_attr::(crate::ATTR_RUST_SERDE_TYPE) - .is_some() - { - // NOTE: legacy serde-based hacks. - continue; - } - - // TODO(#4478): add a 'testing' scope - if obj.fqname.contains("testing") { - continue; - } - - let quoted_imports = quoted_imports.to_string(); - let quoted_impl = quote_to_archetype_impl(objects, obj); - - let mut code = String::new(); - code.push_str(&format!("// {}\n\n", crate::codegen::autogen_warning!())); - code.push_str("#![allow(unused_imports)]\n"); - code.push_str("#![allow(unused_parens)]\n"); - code.push_str("#![allow(clippy::clone_on_copy)]\n"); - code.push_str("#![allow(clippy::cloned_instead_of_copied)]\n"); - if obj.deprecation_notice().is_some() { - code.push_str("#![allow(deprecated)]\n"); - } - code.push_str(&format!("\n\n{quoted_imports}\n\n")); - code.push_str("ed_impl.to_string()); - - let arch_name = obj.snake_case_name(); - files_to_write.insert( - generated_path.join([arch_name.as_str(), "rs"].join(".")), - code.replace(&format!("{NEWLINE_TOKEN:?}"), "\n\n") - .replace(&format!("{COMMENT_SEPARATOR_TOKEN:?}"), "\n\n// --- \n\n") - .replace( - &format!("{COMMENT_REQUIRED_TOKEN:?}"), - "\n\n// --- Required ---\n\n", - ) - .replace( - &format!("{COMMENT_RECOMMENDED_OPTIONAL_TOKEN:?}"), - "\n\n// --- Recommended/Optional ---\n\n", - ), - ); - } -} - -fn quote_to_archetype_impl(objects: &Objects, obj: &Object) -> TokenStream { - assert!(obj.kind == ObjectKind::Archetype); - - let quoted_arch_fqname = quote_fqname_as_type_path(&obj.crate_name(), &obj.fqname); - - let quoted_required = obj - .fields - .iter() - .filter(|obj_field| obj_field.kind() == Some(FieldKind::Required)) - .filter_map(|obj_field| { - let quoted_name = format_ident!("{}", obj_field.name); - - let type_fqname = obj_field.typ.fqname()?; - let type_name = type_fqname.rsplit_once('.').map(|(_, name)| name)?; - - let quoted_type_name = format_ident!("{type_name}"); - let quoted_type_fqname = - quote_fqname_as_type_path(&objects[type_fqname].crate_name(), type_fqname); - - let quoted_data = if obj_field.typ.is_plural() { - quote!(data.to_vec()) - } else { - quote! {{ - let Some(first) = data.first().cloned() else { - return PromiseResult::Error( - std::sync::Arc::new(re_types_core::DeserializationError::missing_data()) - ); - }; - first - }} - }; - - Some(quote! { - #NEWLINE_TOKEN - - use #quoted_type_fqname; - let #quoted_name = match self.get_required(<#quoted_type_name>::name()) { - Ok(#quoted_name) => #quoted_name, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }; - let #quoted_name = match #quoted_name.to_dense::<#quoted_type_name>(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => #quoted_data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - }) - }); - - let quoted_optional = obj - .fields - .iter() - .filter(|obj_field| obj_field.kind() != Some(FieldKind::Required)) - .filter_map(|obj_field| { - let quoted_name = format_ident!("{}", obj_field.name); - - let type_fqname = obj_field.typ.fqname()?; - let type_name = type_fqname.rsplit_once('.').map(|(_, name)| name)?; - - let quoted_type_name = format_ident!("{type_name}"); - let quoted_type_fqname = - quote_fqname_as_type_path(&objects[type_fqname].crate_name(), type_fqname); - - if obj_field.is_nullable { - let quoted_data = if obj_field.typ.is_plural() { - quote!(Some(data.to_vec())) - } else { - quote!(data.first().cloned()) - }; - - Some(quote! { - #NEWLINE_TOKEN - - use #quoted_type_fqname; - let #quoted_name = if let Some(#quoted_name) = self.get(<#quoted_type_name>::name()) { - match #quoted_name.to_dense::<#quoted_type_name>(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => #quoted_data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - } - } else { - None - }; - }) - } else { - let quoted_data = if obj_field.typ.is_plural() { - quote!(data.to_vec()) - } else { - panic!("optional, non-nullable, non-plural data is not representable"); - }; - - Some(quote! { - #NEWLINE_TOKEN - - use #quoted_type_fqname; - let #quoted_name = - match self.get_or_empty(<#quoted_type_name>::name()).to_dense::<#quoted_type_name>(resolver) { - PromiseResult::Pending => return PromiseResult::Pending, - PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), - PromiseResult::Ready(query_res) => match query_res { - Ok(data) => #quoted_data, - Err(query_err) => return PromiseResult::Ready(Err(query_err)), - }, - }; - }) - } - - }); - - let quoted_fields = obj.fields.iter().map(|obj_field| { - let quoted_name = format_ident!("{}", obj_field.name); - quote!(#quoted_name) - }); - - quote! { - impl crate::ToArchetype<#quoted_arch_fqname> for LatestAtResults { - #[inline] - fn to_archetype( - &self, - resolver: &PromiseResolver, - ) -> PromiseResult> { - #NEWLINE_TOKEN - re_tracing::profile_function!(<#quoted_arch_fqname>::name()); - #NEWLINE_TOKEN - - // --- Required --- - #COMMENT_REQUIRED_TOKEN - - #(#quoted_required)* - - // --- Recommended/Optional --- - #COMMENT_RECOMMENDED_OPTIONAL_TOKEN - - #(#quoted_optional)* - - // --- - #COMMENT_SEPARATOR_TOKEN - - // TODO(cmc): A lot of useless copying going on since archetypes are fully owned - // types. Probably fine for now since these are very high-level APIs anyhow. - let arch = #quoted_arch_fqname { - #(#quoted_fields),* - }; - - #NEWLINE_TOKEN - - PromiseResult::Ready(Ok(arch)) - } - } - } -} - -// --- - -fn quote_fqname_as_type_path(crate_name: &str, fqname: impl AsRef) -> TokenStream { - let fqname = fqname - .as_ref() - .replace('.', "::") - .replace("rerun", crate_name); - let expr: syn::TypePath = syn::parse_str(&fqname).unwrap(); - quote!(#expr) -} diff --git a/examples/rust/custom_space_view/src/color_coordinates_visualizer_system.rs b/examples/rust/custom_space_view/src/color_coordinates_visualizer_system.rs index 318d805ed13c..615ad1e039f7 100644 --- a/examples/rust/custom_space_view/src/color_coordinates_visualizer_system.rs +++ b/examples/rust/custom_space_view/src/color_coordinates_visualizer_system.rs @@ -1,7 +1,7 @@ use re_viewer::external::{ egui, re_log_types::{EntityPath, Instance}, - re_query, re_renderer, + re_renderer, re_types::{self, components::Color, ComponentName, Loggable as _}, re_viewer_context::{ self, IdentifiedViewSystem, SpaceViewSystemExecutionError, ViewContextCollection, @@ -38,16 +38,6 @@ impl re_types::Archetype for ColorArchetype { } } -impl re_query::ToArchetype for re_query::LatestAtResults { - #[inline] - fn to_archetype( - &self, - _resolver: &re_query::PromiseResolver, - ) -> re_query::PromiseResult> { - re_query::PromiseResult::Ready(Ok(ColorArchetype)) - } -} - impl IdentifiedViewSystem for InstanceColorSystem { fn identifier() -> ViewSystemIdentifier { "InstanceColor".into()