diff --git a/Cargo.lock b/Cargo.lock index 54cec98276dc..0a4b68f927ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4115,6 +4115,7 @@ dependencies = [ "re_log_types", "re_tracing", "re_types", + "re_types_core", "smallvec", "thiserror", "tinyvec", @@ -4194,6 +4195,7 @@ dependencies = [ "re_smart_channel", "re_tracing", "re_types", + "re_types_core", "serde", "thiserror", ] @@ -4314,6 +4316,7 @@ dependencies = [ "re_tracing", "re_tuid", "re_types", + "re_types_core", "rmp-serde", "serde", "serde_bytes", @@ -4366,6 +4369,7 @@ dependencies = [ "re_log_types", "re_tracing", "re_types", + "re_types_core", "thiserror", ] @@ -4448,6 +4452,7 @@ dependencies = [ "re_sdk_comms", "re_smart_channel", "re_types", + "re_types_core", "re_web_viewer_server", "re_ws_comms", "similar-asserts", @@ -4686,9 +4691,8 @@ dependencies = [ "document-features", "getrandom", "once_cell", - "re_types", + "re_types_core", "serde", - "thiserror", "web-time", ] @@ -4699,7 +4703,6 @@ dependencies = [ "anyhow", "array-init", "arrow2", - "backtrace", "bytemuck", "document-features", "ecolor", @@ -4714,11 +4717,10 @@ dependencies = [ "rand", "rayon", "re_build_tools", - "re_error", "re_log", - "re_string_interner", "re_tracing", "re_types_builder", + "re_types_core", "serde", "similar-asserts", "smallvec", @@ -4754,6 +4756,22 @@ dependencies = [ "xshell", ] +[[package]] +name = "re_types_core" +version = "0.10.0-alpha.7+dev" +dependencies = [ + "anyhow", + "arrow2", + "backtrace", + "document-features", + "re_error", + "re_string_interner", + "re_tracing", + "serde", + "smallvec", + "thiserror", +] + [[package]] name = "re_ui" version = "0.10.0-alpha.7+dev" @@ -4776,7 +4794,6 @@ version = "0.10.0-alpha.7+dev" dependencies = [ "ahash 0.8.3", "anyhow", - "arrow2", "bytemuck", "cfg-if", "eframe", diff --git a/Cargo.toml b/Cargo.toml index 15f9c9c2fba5..f49dbb1f9bc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,6 +58,7 @@ re_tensor_ops = { path = "crates/re_tensor_ops", version = "=0.10.0-alpha.7", de re_time_panel = { path = "crates/re_time_panel", version = "=0.10.0-alpha.7", default-features = false } re_tracing = { path = "crates/re_tracing", version = "=0.10.0-alpha.7", default-features = false } re_tuid = { path = "crates/re_tuid", version = "=0.10.0-alpha.7", default-features = false } +re_types_core = { path = "crates/re_types_core", version = "=0.10.0-alpha.7", default-features = false } re_types = { path = "crates/re_types", version = "=0.10.0-alpha.7", default-features = false } re_types_builder = { path = "crates/re_types_builder", version = "=0.10.0-alpha.7", default-features = false } re_ui = { path = "crates/re_ui", version = "=0.10.0-alpha.7", default-features = false } @@ -158,9 +159,12 @@ puffin_http = "0.13" rand = { version = "0.8", default-features = false } rayon = "1.7" rfd = { version = "0.12", default_features = false, features = ["xdg-portal"] } +rmp-serde = "1" ron = "0.8.0" serde = "1" +serde_bytes = "0.11" serde_json = { version = "1", default-features = false, features = ["std"] } +serde_test = "1" serde_yaml = { version = "0.9.21", default-features = false } sha2 = "0.10" similar-asserts = "1.4.2" diff --git a/crates/re_arrow_store/Cargo.toml b/crates/re_arrow_store/Cargo.toml index 2a2a251d4f0c..9ba9deda9675 100644 --- a/crates/re_arrow_store/Cargo.toml +++ b/crates/re_arrow_store/Cargo.toml @@ -40,6 +40,8 @@ re_format.workspace = true re_log_types.workspace = true re_log.workspace = true re_tracing.workspace = true +# NOTE: We're on our way to make this crate re_types-free, which is why we import both. +re_types_core.workspace = true re_types.workspace = true # External dependencies: diff --git a/crates/re_arrow_store/benches/arrow2.rs b/crates/re_arrow_store/benches/arrow2.rs index 7a0c0dc4e0b1..54ba1c24a9fc 100644 --- a/crates/re_arrow_store/benches/arrow2.rs +++ b/crates/re_arrow_store/benches/arrow2.rs @@ -9,13 +9,13 @@ use arrow2::array::{Array, PrimitiveArray, StructArray, UnionArray}; use criterion::Criterion; use itertools::Itertools; -use re_log_types::{DataCell, SizeBytes as _}; +use re_log_types::DataCell; use re_types::datagen::{build_some_instances, build_some_positions2d}; use re_types::{ components::{InstanceKey, Position2D}, testing::{build_some_large_structs, LargeStruct}, - Component, }; +use re_types_core::{Component, SizeBytes as _}; // --- diff --git a/crates/re_arrow_store/benches/data_store.rs b/crates/re_arrow_store/benches/data_store.rs index 1f8185e5b61e..9b0e4719d3af 100644 --- a/crates/re_arrow_store/benches/data_store.rs +++ b/crates/re_arrow_store/benches/data_store.rs @@ -15,8 +15,8 @@ use re_types::datagen::build_some_instances; use re_types::{ components::InstanceKey, testing::{build_some_large_structs, LargeStruct}, - ComponentName, Loggable as _, }; +use re_types_core::{ComponentName, Loggable as _}; criterion_group!(benches, insert, latest_at, latest_at_missing, range, gc); criterion_main!(benches); diff --git a/crates/re_arrow_store/examples/dump_dataframe.rs b/crates/re_arrow_store/examples/dump_dataframe.rs index 0728c018788a..495b8a031244 100644 --- a/crates/re_arrow_store/examples/dump_dataframe.rs +++ b/crates/re_arrow_store/examples/dump_dataframe.rs @@ -7,7 +7,8 @@ use re_arrow_store::{test_row, DataStore}; use re_log_types::{build_frame_nr, build_log_time, EntityPath, Time}; use re_types::datagen::{build_some_instances, build_some_instances_from, build_some_positions2d}; -use re_types::{components::InstanceKey, testing::build_some_large_structs, Loggable}; +use re_types::{components::InstanceKey, testing::build_some_large_structs}; +use re_types_core::Loggable as _; // --- diff --git a/crates/re_arrow_store/examples/latest_component.rs b/crates/re_arrow_store/examples/latest_component.rs index 35d6248e0985..a774cf8b897b 100644 --- a/crates/re_arrow_store/examples/latest_component.rs +++ b/crates/re_arrow_store/examples/latest_component.rs @@ -11,8 +11,8 @@ use re_types::datagen::build_some_positions2d; use re_types::{ components::{InstanceKey, Position2D}, testing::{build_some_large_structs, LargeStruct}, - Loggable, }; +use re_types_core::Loggable as _; fn main() { let mut store = DataStore::new(InstanceKey::name(), Default::default()); diff --git a/crates/re_arrow_store/examples/latest_components.rs b/crates/re_arrow_store/examples/latest_components.rs index 5203c312cc46..8189b4bfee8d 100644 --- a/crates/re_arrow_store/examples/latest_components.rs +++ b/crates/re_arrow_store/examples/latest_components.rs @@ -13,8 +13,8 @@ use re_types::datagen::build_some_positions2d; use re_types::{ components::{InstanceKey, Position2D}, testing::{build_some_large_structs, LargeStruct}, - Loggable, }; +use re_types_core::Loggable as _; fn main() { let mut store = DataStore::new(InstanceKey::name(), Default::default()); diff --git a/crates/re_arrow_store/examples/range_components.rs b/crates/re_arrow_store/examples/range_components.rs index ef09b823297d..448bc4528544 100644 --- a/crates/re_arrow_store/examples/range_components.rs +++ b/crates/re_arrow_store/examples/range_components.rs @@ -11,8 +11,8 @@ use re_types::datagen::build_some_positions2d; use re_types::{ components::{InstanceKey, Position2D}, testing::{build_some_large_structs, LargeStruct}, - Loggable as _, }; +use re_types_core::Loggable as _; fn main() { let mut store = DataStore::new(InstanceKey::name(), Default::default()); diff --git a/crates/re_arrow_store/src/polars_util.rs b/crates/re_arrow_store/src/polars_util.rs index ff963abbc0ed..1d9bb73e5117 100644 --- a/crates/re_arrow_store/src/polars_util.rs +++ b/crates/re_arrow_store/src/polars_util.rs @@ -2,7 +2,7 @@ use itertools::Itertools; use polars_core::{prelude::*, series::Series}; use polars_ops::prelude::*; use re_log_types::{DataCell, EntityPath, RowId, TimeInt}; -use re_types::ComponentName; +use re_types_core::ComponentName; use crate::{ArrayExt, DataStore, LatestAtQuery, RangeQuery}; diff --git a/crates/re_arrow_store/src/store.rs b/crates/re_arrow_store/src/store.rs index 083883e84a99..d67f4a1aa8a9 100644 --- a/crates/re_arrow_store/src/store.rs +++ b/crates/re_arrow_store/src/store.rs @@ -5,12 +5,12 @@ use ahash::HashMap; use arrow2::datatypes::DataType; use nohash_hasher::IntMap; use parking_lot::RwLock; -use re_types::{ComponentName, ComponentNameSet}; +use re_types_core::{ComponentName, ComponentNameSet, SizeBytes}; use smallvec::SmallVec; use re_log_types::{ DataCell, DataCellColumn, EntityPath, EntityPathHash, ErasedTimeVec, NumInstancesVec, RowId, - RowIdVec, SizeBytes, TimeInt, TimePoint, TimeRange, Timeline, + RowIdVec, TimeInt, TimePoint, TimeRange, Timeline, }; // --- Data store --- @@ -285,7 +285,7 @@ impl DataStore { &self.config } - /// Lookup the arrow [`DataType`] of a [`re_types::Component`] in the internal + /// Lookup the arrow [`DataType`] of a [`re_types_core::Component`] in the internal /// `DataTypeRegistry`. pub fn lookup_datatype(&self, component: &ComponentName) -> Option<&DataType> { self.type_registry.get(component) @@ -336,10 +336,10 @@ impl DataStore { #[test] fn datastore_internal_repr() { use re_log_types::DataTable; - use re_types::{components::InstanceKey, Loggable as _}; + use re_types_core::Loggable as _; let mut store = DataStore::new( - InstanceKey::name(), + re_types::components::InstanceKey::name(), DataStoreConfig { indexed_bucket_num_rows: 0, store_insert_ids: true, diff --git a/crates/re_arrow_store/src/store_arrow.rs b/crates/re_arrow_store/src/store_arrow.rs index 08c3fb774f79..fae89b7feacc 100644 --- a/crates/re_arrow_store/src/store_arrow.rs +++ b/crates/re_arrow_store/src/store_arrow.rs @@ -6,7 +6,7 @@ use re_log_types::{ DataCellColumn, DataTable, DataTableResult, RowId, Timeline, COLUMN_INSERT_ID, COLUMN_NUM_INSTANCES, }; -use re_types::ComponentName; +use re_types_core::ComponentName; use crate::store::{IndexedBucket, IndexedBucketInner, PersistentIndexedTable}; diff --git a/crates/re_arrow_store/src/store_format.rs b/crates/re_arrow_store/src/store_format.rs index 34815a95bd37..42c1066f74ee 100644 --- a/crates/re_arrow_store/src/store_format.rs +++ b/crates/re_arrow_store/src/store_format.rs @@ -1,5 +1,5 @@ use re_format::{format_bytes, format_number}; -use re_log_types::SizeBytes as _; +use re_types_core::SizeBytes as _; use crate::{DataStore, IndexedBucket, IndexedTable, PersistentIndexedTable}; diff --git a/crates/re_arrow_store/src/store_gc.rs b/crates/re_arrow_store/src/store_gc.rs index 90171804bfcc..054955dd2ddf 100644 --- a/crates/re_arrow_store/src/store_gc.rs +++ b/crates/re_arrow_store/src/store_gc.rs @@ -1,8 +1,8 @@ use ahash::{HashMap, HashSet}; use nohash_hasher::IntMap; -use re_log_types::{EntityPathHash, RowId, SizeBytes as _, TimeInt, TimeRange, Timeline}; -use re_types::ComponentName; +use re_log_types::{EntityPathHash, RowId, TimeInt, TimeRange, Timeline}; +use re_types_core::{ComponentName, SizeBytes as _}; use crate::{ store::{IndexedBucketInner, IndexedTable, PersistentIndexedTable}, diff --git a/crates/re_arrow_store/src/store_helpers.rs b/crates/re_arrow_store/src/store_helpers.rs index 3a14190cbd8f..61594ac463c1 100644 --- a/crates/re_arrow_store/src/store_helpers.rs +++ b/crates/re_arrow_store/src/store_helpers.rs @@ -1,6 +1,6 @@ use re_log_types::{DataCell, DataRow, EntityPath, RowId, TimePoint, Timeline}; -use re_types::{Component, ComponentName}; +use re_types_core::{Component, ComponentName}; use crate::{DataStore, LatestAtQuery}; @@ -35,7 +35,7 @@ impl std::ops::Deref for VersionedComponent { } impl DataStore { - /// Get the latest value for a given [`re_types::Component`] and the associated [`RowId`]. + /// Get the latest value for a given [`re_types_core::Component`] and the associated [`RowId`]. /// /// This assumes that the row we get from the store only contains a single instance for this /// component; it will log a warning otherwise. @@ -110,7 +110,7 @@ impl DataStore { None } - /// Get the latest value for a given [`re_types::Component`] and the associated [`RowId`], assuming it is timeless. + /// Get the latest value for a given [`re_types_core::Component`] and the associated [`RowId`], assuming it is timeless. /// /// This assumes that the row we get from the store only contains a single instance for this /// component; it will log a warning otherwise. @@ -132,7 +132,7 @@ impl DataStore { // --- Write --- impl DataStore { - /// Stores a single value for a given [`re_types::Component`]. + /// Stores a single value for a given [`re_types_core::Component`]. /// /// This is a best-effort helper, it will merely log errors on failure. pub fn insert_component<'a, C>( @@ -172,7 +172,7 @@ impl DataStore { } } - /// Stores a single empty value for a given [`re_log_types::ComponentName`]. + /// Stores a single empty value for a given [`re_types_core::ComponentName`]. /// /// This is a best-effort helper, it will merely log errors on failure. pub fn insert_empty_component( diff --git a/crates/re_arrow_store/src/store_polars.rs b/crates/re_arrow_store/src/store_polars.rs index f3cc8f6a26c5..2e29bfefb146 100644 --- a/crates/re_arrow_store/src/store_polars.rs +++ b/crates/re_arrow_store/src/store_polars.rs @@ -10,7 +10,7 @@ use arrow2::{ }; use polars_core::{functions::diag_concat_df, prelude::*}; use re_log_types::{DataCell, DataTable}; -use re_types::ComponentName; +use re_types_core::ComponentName; use crate::{ store::InsertIdVec, ArrayExt, DataStore, DataStoreConfig, IndexedBucket, IndexedBucketInner, diff --git a/crates/re_arrow_store/src/store_read.rs b/crates/re_arrow_store/src/store_read.rs index eb72c7160afd..781454b91688 100644 --- a/crates/re_arrow_store/src/store_read.rs +++ b/crates/re_arrow_store/src/store_read.rs @@ -3,7 +3,7 @@ use std::{ops::RangeBounds, sync::atomic::Ordering}; use itertools::Itertools; use re_log::trace; use re_log_types::{DataCell, EntityPath, RowId, TimeInt, TimePoint, TimeRange, Timeline}; -use re_types::{ComponentName, ComponentNameSet}; +use re_types_core::{ComponentName, ComponentNameSet}; use smallvec::SmallVec; use crate::{DataStore, IndexedBucket, IndexedBucketInner, IndexedTable, PersistentIndexedTable}; @@ -190,7 +190,7 @@ impl DataStore { /// ```rust /// # use polars_core::{prelude::*, series::Series}; /// # use re_log_types::{EntityPath, RowId, TimeInt}; - /// # use re_types::{ComponentName}; + /// # use re_types_core::{ComponentName}; /// # use re_arrow_store::{DataStore, LatestAtQuery, RangeQuery}; /// # /// pub fn latest_component( @@ -359,7 +359,7 @@ impl DataStore { /// # use polars_core::{prelude::*, series::Series}; /// # use re_log_types::{DataCell, EntityPath, RowId, TimeInt}; /// # use re_arrow_store::{DataStore, LatestAtQuery, RangeQuery}; - /// # use re_types::ComponentName; + /// # use re_types_core::ComponentName; /// # /// # pub fn dataframe_from_cells( /// # cells: [Option; N], diff --git a/crates/re_arrow_store/src/store_sanity.rs b/crates/re_arrow_store/src/store_sanity.rs index 80e7fdb3c997..028565104b98 100644 --- a/crates/re_arrow_store/src/store_sanity.rs +++ b/crates/re_arrow_store/src/store_sanity.rs @@ -1,7 +1,5 @@ -use re_log_types::{ - DataCellColumn, RowId, SizeBytes as _, TimeRange, COLUMN_NUM_INSTANCES, COLUMN_TIMEPOINT, -}; -use re_types::{ComponentName, Loggable}; +use re_log_types::{DataCellColumn, RowId, TimeRange, COLUMN_NUM_INSTANCES, COLUMN_TIMEPOINT}; +use re_types_core::{ComponentName, Loggable, SizeBytes as _}; use crate::{DataStore, IndexedBucket, IndexedBucketInner, IndexedTable, PersistentIndexedTable}; diff --git a/crates/re_arrow_store/src/store_stats.rs b/crates/re_arrow_store/src/store_stats.rs index f25ed0bc85ba..f1e271155679 100644 --- a/crates/re_arrow_store/src/store_stats.rs +++ b/crates/re_arrow_store/src/store_stats.rs @@ -1,6 +1,6 @@ use nohash_hasher::IntMap; -use re_log_types::{SizeBytes, TimePoint, TimeRange}; -use re_types::ComponentName; +use re_log_types::{TimePoint, TimeRange}; +use re_types_core::{ComponentName, SizeBytes}; use crate::{ store::IndexedBucketInner, ClusterCellCache, DataStore, DataTypeRegistry, IndexedBucket, diff --git a/crates/re_arrow_store/src/store_write.rs b/crates/re_arrow_store/src/store_write.rs index fd45e19c02fc..09adb801dff0 100644 --- a/crates/re_arrow_store/src/store_write.rs +++ b/crates/re_arrow_store/src/store_write.rs @@ -6,10 +6,11 @@ use smallvec::SmallVec; use re_log::{debug, trace}; use re_log_types::{ - DataCell, DataCellColumn, DataCellError, DataRow, DataTable, RowId, SizeBytes as _, TimeInt, - TimePoint, TimeRange, + DataCell, DataCellColumn, DataCellError, DataRow, DataTable, RowId, TimeInt, TimePoint, + TimeRange, }; -use re_types::{components::InstanceKey, ComponentName, ComponentNameSet, Loggable}; +use re_types::components::InstanceKey; +use re_types_core::{ComponentName, ComponentNameSet, Loggable, SizeBytes as _}; use crate::{ store::MetadataRegistry, DataStore, DataStoreConfig, IndexedBucket, IndexedBucketInner, diff --git a/crates/re_arrow_store/tests/correctness.rs b/crates/re_arrow_store/tests/correctness.rs index 12e6668f18f2..e24d7dcb0be0 100644 --- a/crates/re_arrow_store/tests/correctness.rs +++ b/crates/re_arrow_store/tests/correctness.rs @@ -13,8 +13,9 @@ use re_arrow_store::{ use re_log_types::{ build_frame_nr, build_log_time, DataCell, Duration, EntityPath, Time, TimeType, Timeline, }; +use re_types::components::InstanceKey; use re_types::datagen::{build_some_colors, build_some_instances, build_some_positions2d}; -use re_types::{components::InstanceKey, Loggable as _}; +use re_types_core::Loggable as _; // --- diff --git a/crates/re_arrow_store/tests/data_store.rs b/crates/re_arrow_store/tests/data_store.rs index b3471dc2b2c7..47eb3e08a887 100644 --- a/crates/re_arrow_store/tests/data_store.rs +++ b/crates/re_arrow_store/tests/data_store.rs @@ -24,8 +24,8 @@ use re_types::datagen::{ use re_types::{ components::{Color, InstanceKey, Position2D}, testing::{build_some_large_structs, LargeStruct}, - ComponentName, Loggable as _, }; +use re_types_core::{ComponentName, Loggable as _}; // --- LatestComponentsAt --- diff --git a/crates/re_arrow_store/tests/dump.rs b/crates/re_arrow_store/tests/dump.rs index f44e849a69ad..76dc579f526c 100644 --- a/crates/re_arrow_store/tests/dump.rs +++ b/crates/re_arrow_store/tests/dump.rs @@ -8,8 +8,9 @@ use re_arrow_store::{ TimeInt, TimeRange, Timeline, }; use re_log_types::{build_frame_nr, build_log_time, DataTable, EntityPath, TableId}; +use re_types::components::InstanceKey; use re_types::datagen::{build_some_colors, build_some_instances, build_some_positions2d}; -use re_types::{components::InstanceKey, Loggable as _}; +use re_types_core::Loggable as _; // --- Dump --- diff --git a/crates/re_arrow_store/tests/internals.rs b/crates/re_arrow_store/tests/internals.rs index a018e39ba57a..92f7d4c12b04 100644 --- a/crates/re_arrow_store/tests/internals.rs +++ b/crates/re_arrow_store/tests/internals.rs @@ -6,7 +6,8 @@ use std::sync::atomic::{AtomicBool, Ordering::SeqCst}; use re_arrow_store::{DataStore, DataStoreConfig}; use re_log_types::{build_frame_nr, DataRow, EntityPath, RowId, TimePoint}; -use re_types::{components::InstanceKey, datagen::build_some_instances, Loggable as _}; +use re_types::{components::InstanceKey, datagen::build_some_instances}; +use re_types_core::Loggable as _; // --- Internals --- diff --git a/crates/re_data_store/Cargo.toml b/crates/re_data_store/Cargo.toml index 89a8789e199b..fd830ae5d46e 100644 --- a/crates/re_data_store/Cargo.toml +++ b/crates/re_data_store/Cargo.toml @@ -32,6 +32,8 @@ re_log_types.workspace = true re_log.workspace = true re_smart_channel.workspace = true re_tracing.workspace = true +# NOTE: We're on our way to make this crate re_types-free, which is why we import both. +re_types_core.workspace = true re_types.workspace = true document-features.workspace = true diff --git a/crates/re_data_store/src/entity_tree.rs b/crates/re_data_store/src/entity_tree.rs index c9a2d3b6fcb1..250349ee41c5 100644 --- a/crates/re_data_store/src/entity_tree.rs +++ b/crates/re_data_store/src/entity_tree.rs @@ -6,7 +6,7 @@ use nohash_hasher::IntMap; use re_log_types::{ ComponentPath, EntityPath, EntityPathPart, PathOp, RowId, TimeInt, TimePoint, Timeline, }; -use re_types::{ComponentName, Loggable}; +use re_types_core::{ComponentName, Loggable}; // ---------------------------------------------------------------------------- @@ -220,7 +220,8 @@ impl EntityTree { time_point: &TimePoint, path_op: &PathOp, ) -> Vec { - use re_types::{archetypes::Clear, components::ClearIsRecursive, Archetype as _}; + use re_types::{archetypes::Clear, components::ClearIsRecursive}; + use re_types_core::Archetype as _; re_tracing::profile_function!(); diff --git a/crates/re_data_store/src/lib.rs b/crates/re_data_store/src/lib.rs index a60e0ef4218d..95fafab66017 100644 --- a/crates/re_data_store/src/lib.rs +++ b/crates/re_data_store/src/lib.rs @@ -21,7 +21,7 @@ pub use self::versioned_instance_path::{VersionedInstancePath, VersionedInstance #[cfg(feature = "serde")] pub use editable_auto_value::EditableAutoValue; use re_log_types::DataTableError; -pub use re_log_types::{ComponentName, EntityPath, EntityPathPart, Index, TimeInt, Timeline}; +pub use re_log_types::{EntityPath, EntityPathPart, Index, TimeInt, Timeline}; // ---------------------------------------------------------------------------- diff --git a/crates/re_data_store/src/store_db.rs b/crates/re_data_store/src/store_db.rs index 26b94a42b1e5..a54d1242b400 100644 --- a/crates/re_data_store/src/store_db.rs +++ b/crates/re_data_store/src/store_db.rs @@ -7,7 +7,8 @@ use re_log_types::{ ApplicationId, ComponentPath, DataCell, DataRow, DataTable, EntityPath, EntityPathHash, LogMsg, PathOp, RowId, SetStoreInfo, StoreId, StoreInfo, StoreKind, TimePoint, Timeline, }; -use re_types::{components::InstanceKey, Loggable as _}; +use re_types::components::InstanceKey; +use re_types_core::Loggable; use crate::{Error, TimesPerTimeline}; diff --git a/crates/re_data_ui/src/component_ui_registry.rs b/crates/re_data_ui/src/component_ui_registry.rs index 0fe125351c3b..307f0b9ceca9 100644 --- a/crates/re_data_ui/src/component_ui_registry.rs +++ b/crates/re_data_ui/src/component_ui_registry.rs @@ -70,7 +70,7 @@ fn fallback_component_ui( } fn arrow_ui(ui: &mut egui::Ui, verbosity: UiVerbosity, array: &dyn arrow2::array::Array) { - use re_log_types::SizeBytes as _; + use re_types::SizeBytes as _; // Special-treat text. // Note: we match on the raw data here, so this works for any component containing text. diff --git a/crates/re_format/src/arrow.rs b/crates/re_format/src/arrow.rs index 2963dc8771c3..8b21bcb1d459 100644 --- a/crates/re_format/src/arrow.rs +++ b/crates/re_format/src/arrow.rs @@ -8,7 +8,7 @@ use arrow2::{ }; use comfy_table::{presets, Cell, Table}; -use re_tuid::{external::re_types::Loggable as _, Tuid}; +use re_tuid::{external::re_types_core::Loggable as _, Tuid}; // --- diff --git a/crates/re_log_encoding/Cargo.toml b/crates/re_log_encoding/Cargo.toml index 9759876ca4be..f12118f83506 100644 --- a/crates/re_log_encoding/Cargo.toml +++ b/crates/re_log_encoding/Cargo.toml @@ -42,7 +42,7 @@ thiserror.workspace = true web-time.workspace = true # Optional external dependencies: -rmp-serde = { version = "1", optional = true } +rmp-serde = { workspace = true, optional = true } lz4_flex = { version = "0.10", optional = true } # Web dependencies: @@ -53,11 +53,11 @@ wasm-bindgen-futures = "0.4" web-sys = { version = "0.3.52", features = ["Window"] } [dev-dependencies] -re_types = { workspace = true, features = ["datagen"] } +re_types = { workspace = true, features = ["datagen", "serde"] } criterion = "0.5" mimalloc.workspace = true -serde_test = { version = "1" } +serde_test.workspace = true [lib] bench = false diff --git a/crates/re_log_types/Cargo.toml b/crates/re_log_types/Cargo.toml index e8a658a628fd..a16c30182efe 100644 --- a/crates/re_log_types/Cargo.toml +++ b/crates/re_log_types/Cargo.toml @@ -26,6 +26,7 @@ serde = [ "dep:serde_bytes", "re_string_interner/serde", "re_tuid/serde", + "re_types_core/serde", "re_types/serde", ] @@ -38,6 +39,8 @@ re_log.workspace = true re_string_interner.workspace = true re_tracing.workspace = true re_tuid = { workspace = true, features = ["arrow"] } +# NOTE: We're on our way to make this crate re_types-free, which is why we import both. +re_types_core.workspace = true re_types = { workspace = true, features = ["image"] } # External @@ -70,9 +73,9 @@ web-time.workspace = true # Optional dependencies: -rmp-serde = { version = "1.1", optional = true } +rmp-serde = { workspace = true, optional = true } serde = { workspace = true, optional = true, features = ["derive", "rc"] } -serde_bytes = { version = "0.11", optional = true } +serde_bytes = { workspace = true, optional = true } # Native dependencies: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/crates/re_log_types/src/data_cell.rs b/crates/re_log_types/src/data_cell.rs index dc4b979463e1..96c0a46c45da 100644 --- a/crates/re_log_types/src/data_cell.rs +++ b/crates/re_log_types/src/data_cell.rs @@ -1,9 +1,8 @@ use std::sync::Arc; use arrow2::datatypes::DataType; -use re_types::{Component, ComponentBatch, ComponentName, DeserializationError}; -use crate::SizeBytes; +use re_types_core::{Component, ComponentBatch, ComponentName, DeserializationError, SizeBytes}; // --- @@ -16,10 +15,10 @@ pub enum DataCellError { Arrow(#[from] arrow2::error::Error), #[error("Could not deserialize data from Arrow: {0}")] - LoggableDeserialize(#[from] re_types::DeserializationError), + LoggableDeserialize(#[from] re_types_core::DeserializationError), #[error("Could not serialize data from Arrow: {0}")] - LoggableSerialize(#[from] re_types::SerializationError), + LoggableSerialize(#[from] re_types_core::SerializationError), // Needed to handle TryFrom -> T #[error("Infallible")] @@ -75,9 +74,9 @@ pub type DataCellResult = ::std::result::Result; /// # use arrow2_convert::field::ArrowField as _; /// # use itertools::Itertools as _; /// # -/// # use re_log_types::{DataCell}; +/// # use re_log_types::DataCell; /// # use re_log_types::example_components::MyPoint; -/// # use re_types::Loggable as _; +/// # use re_types_core::Loggable as _; /// # /// let points: &[MyPoint] = &[ /// MyPoint { x: 10.0, y: 10.0 }, @@ -166,7 +165,9 @@ pub struct DataCellInner { impl DataCell { /// Builds a new `DataCell` from a component batch. #[inline] - pub fn from_component_batch(batch: &dyn ComponentBatch) -> re_types::SerializationResult { + pub fn from_component_batch( + batch: &dyn ComponentBatch, + ) -> re_types_core::SerializationResult { batch .to_arrow() .map(|arrow| DataCell::from_arrow(batch.name(), arrow)) @@ -647,7 +648,8 @@ impl DataCellInner { fn data_cell_sizes() { use crate::DataCell; use arrow2::array::UInt64Array; - use re_types::{components::InstanceKey, Loggable as _}; + use re_types::components::InstanceKey; + use re_types_core::Loggable as _; // not computed // NOTE: Unsized cells are illegal in debug mode and will flat out crash. diff --git a/crates/re_log_types/src/data_row.rs b/crates/re_log_types/src/data_row.rs index 918e41b594b4..b9e756725185 100644 --- a/crates/re_log_types/src/data_row.rs +++ b/crates/re_log_types/src/data_row.rs @@ -1,9 +1,10 @@ use ahash::HashSetExt; use nohash_hasher::IntSet; -use re_types::{AsComponents, ComponentName}; use smallvec::SmallVec; -use crate::{DataCell, DataCellError, DataTable, EntityPath, SizeBytes, TableId, TimePoint}; +use re_types_core::{AsComponents, ComponentName, SizeBytes}; + +use crate::{DataCell, DataCellError, DataTable, EntityPath, TableId, TimePoint}; // --- @@ -278,7 +279,7 @@ impl DataRow { row_id: RowId, timepoint: TimePoint, entity_path: EntityPath, - comp_batches: impl IntoIterator, + comp_batches: impl IntoIterator, ) -> anyhow::Result { re_tracing::profile_function!(); diff --git a/crates/re_log_types/src/data_table.rs b/crates/re_log_types/src/data_table.rs index 23020cc71ffe..a1599ab1a8c8 100644 --- a/crates/re_log_types/src/data_table.rs +++ b/crates/re_log_types/src/data_table.rs @@ -1,15 +1,15 @@ use std::collections::BTreeMap; -use re_types::{ComponentName, Loggable}; - use ahash::HashMap; use itertools::{izip, Itertools as _}; use nohash_hasher::IntSet; use smallvec::SmallVec; +use re_types_core::{ComponentName, Loggable, SizeBytes}; + use crate::{ data_row::DataReadResult, ArrowMsg, DataCell, DataCellError, DataRow, DataRowError, EntityPath, - RowId, SizeBytes, TimePoint, Timeline, + RowId, TimePoint, Timeline, }; // --- @@ -37,10 +37,10 @@ pub enum DataTableError { Arrow(#[from] arrow2::error::Error), #[error("Could not serialize component instances to/from Arrow: {0}")] - Serialization(#[from] re_types::SerializationError), + Serialization(#[from] re_types_core::SerializationError), #[error("Could not deserialize component instances to/from Arrow: {0}")] - Deserialization(#[from] re_types::DeserializationError), + Deserialization(#[from] re_types_core::DeserializationError), // Needed to handle TryFrom -> T #[error("Infallible")] @@ -685,7 +685,7 @@ impl DataTable { } /// Serializes a single control column: an iterable of dense arrow-like data. - pub fn serialize_control_column<'a, C: re_types::Component + 'a>( + pub fn serialize_control_column<'a, C: re_types_core::Component + 'a>( values: &'a [C], ) -> DataTableResult<(Field, Box)> where diff --git a/crates/re_log_types/src/data_table_batcher.rs b/crates/re_log_types/src/data_table_batcher.rs index 0e4239908760..9d0ca4887a78 100644 --- a/crates/re_log_types/src/data_table_batcher.rs +++ b/crates/re_log_types/src/data_table_batcher.rs @@ -5,7 +5,9 @@ use std::{ use crossbeam::channel::{Receiver, Sender}; -use crate::{DataRow, DataTable, SizeBytes, TableId}; +use re_types_core::SizeBytes as _; + +use crate::{DataRow, DataTable, TableId}; // --- diff --git a/crates/re_log_types/src/lib.rs b/crates/re_log_types/src/lib.rs index 2161b4562602..58dcc6011698 100644 --- a/crates/re_log_types/src/lib.rs +++ b/crates/re_log_types/src/lib.rs @@ -57,10 +57,6 @@ pub use self::time_point::{TimeInt, TimePoint, TimeType, Timeline, TimelineName} pub use self::time_range::{TimeRange, TimeRangeF}; pub use self::time_real::TimeReal; -// Re-export `ComponentName` for convenience -pub use re_types::ComponentName; -pub use re_types::SizeBytes; - #[cfg(not(target_arch = "wasm32"))] pub use self::data_table_batcher::{ DataTableBatcher, DataTableBatcherConfig, DataTableBatcherError, @@ -76,7 +72,9 @@ pub use self::load_file::{data_cells_from_file_contents, FromFileError}; pub mod external { pub use arrow2; pub use arrow2_convert; + pub use re_tuid; + pub use re_types_core; } #[macro_export] @@ -398,14 +396,14 @@ impl PathOp { // --------------------------------------------------------------------------- -/// Implements [`re_types::Component`] for `T: arrow2_convert::{Serialize, Deserialize}`. +/// Implements [`::re_types::Component`] for `T: arrow2_convert::{Serialize, Deserialize}`. #[doc(hidden)] #[macro_export] macro_rules! arrow2convert_component_shim { ($entity:ident as $fqname:expr) => { - impl re_types::Loggable for $entity { - type Name = re_types::ComponentName; + impl ::re_types::Loggable for $entity { + type Name = ::re_types::ComponentName; #[inline] fn name() -> Self::Name { @@ -420,7 +418,7 @@ macro_rules! arrow2convert_component_shim { #[inline] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> re_types::SerializationResult> + ) -> ::re_types::SerializationResult> where Self: Clone + 'a, { @@ -433,14 +431,14 @@ macro_rules! arrow2convert_component_shim { let arrow = arrow2_convert::serialize::TryIntoArrow::try_into_arrow(vec.iter()) .map_err(|err| { - re_types::SerializationError::ArrowConvertFailure(err.to_string()) + ::re_types::SerializationError::ArrowConvertFailure(err.to_string()) })?; Ok(arrow) } #[inline] - fn from_arrow_opt(data: &dyn ::arrow2::array::Array) -> re_types::DeserializationResult>> + fn from_arrow_opt(data: &dyn ::arrow2::array::Array) -> ::re_types::DeserializationResult>> where Self: Sized { diff --git a/crates/re_log_types/src/load_file.rs b/crates/re_log_types/src/load_file.rs index fcae2fd15405..f769f0ce0dba 100644 --- a/crates/re_log_types/src/load_file.rs +++ b/crates/re_log_types/src/load_file.rs @@ -38,7 +38,8 @@ pub fn data_cells_from_file_path( match extension.as_str() { "glb" | "gltf" | "obj" => { - use re_types::{archetypes::Asset3D, AsComponents as _}; + use re_types::archetypes::Asset3D; + use re_types_core::AsComponents as _; let cells: Result, _> = Asset3D::from_file(file_path)? // TODO(#3414): this should be a method of `Archetype` .as_component_batches() @@ -70,8 +71,7 @@ pub fn data_cells_from_file_path( } fn image_indicator_cell() -> DataCell { - use re_types::Archetype as _; - + use re_types_core::Archetype as _; let indicator = re_types::archetypes::Image::indicator(); DataCell::from_arrow( indicator.name(), @@ -96,7 +96,8 @@ pub fn data_cells_from_file_contents( match extension.as_str() { "glb" | "gltf" | "obj" => { - use re_types::{archetypes::Asset3D, components::MediaType, AsComponents as _}; + use re_types::{archetypes::Asset3D, components::MediaType}; + use re_types_core::AsComponents as _; let cells: Result, _> = Asset3D::from_bytes(bytes, MediaType::guess_from_path(file_name)) .as_component_batches() diff --git a/crates/re_log_types/src/path/component_path.rs b/crates/re_log_types/src/path/component_path.rs index c26a42988d3e..645d1394250d 100644 --- a/crates/re_log_types/src/path/component_path.rs +++ b/crates/re_log_types/src/path/component_path.rs @@ -1,4 +1,6 @@ -use crate::{path::EntityPath, ComponentName}; +use re_types_core::ComponentName; + +use crate::path::EntityPath; /// A [`EntityPath`] plus a [`ComponentName`]. /// diff --git a/crates/re_log_types/src/path/data_path.rs b/crates/re_log_types/src/path/data_path.rs index 5041c2a387ec..b568e88c41bc 100644 --- a/crates/re_log_types/src/path/data_path.rs +++ b/crates/re_log_types/src/path/data_path.rs @@ -1,4 +1,5 @@ -use re_types::{components::InstanceKey, ComponentName}; +use re_types::components::InstanceKey; +use re_types_core::ComponentName; use crate::EntityPath; diff --git a/crates/re_log_types/src/path/entity_path.rs b/crates/re_log_types/src/path/entity_path.rs index 809717bd8f46..2737b2837765 100644 --- a/crates/re_log_types/src/path/entity_path.rs +++ b/crates/re_log_types/src/path/entity_path.rs @@ -1,6 +1,8 @@ use std::sync::Arc; -use crate::{hash::Hash64, path::entity_path_impl::EntityPathImpl, EntityPathPart, SizeBytes}; +use re_types_core::SizeBytes; + +use crate::{hash::Hash64, path::entity_path_impl::EntityPathImpl, EntityPathPart}; // ---------------------------------------------------------------------------- diff --git a/crates/re_log_types/src/path/parse_path.rs b/crates/re_log_types/src/path/parse_path.rs index 94378eeb1faa..65d645597d0d 100644 --- a/crates/re_log_types/src/path/parse_path.rs +++ b/crates/re_log_types/src/path/parse_path.rs @@ -1,6 +1,7 @@ use std::str::FromStr; -use re_types::{components::InstanceKey, ComponentName}; +use re_types::components::InstanceKey; +use re_types_core::ComponentName; use crate::{ComponentPath, DataPath, EntityPath, EntityPathPart, Index}; diff --git a/crates/re_log_types/src/time_point/mod.rs b/crates/re_log_types/src/time_point/mod.rs index 2c7fbc42f86e..63c73a4aa2e1 100644 --- a/crates/re_log_types/src/time_point/mod.rs +++ b/crates/re_log_types/src/time_point/mod.rs @@ -5,7 +5,7 @@ mod timeline; use crate::{ time::{Time, TimeZone}, - SizeBytes, TimeRange, + TimeRange, }; // Re-exports @@ -93,7 +93,7 @@ impl TimePoint { } } -impl SizeBytes for TimePoint { +impl re_types_core::SizeBytes for TimePoint { #[inline] fn heap_size_bytes(&self) -> u64 { type K = Timeline; diff --git a/crates/re_log_types/src/time_point/timeline.rs b/crates/re_log_types/src/time_point/timeline.rs index 644eeded01f5..3f880eef1aec 100644 --- a/crates/re_log_types/src/time_point/timeline.rs +++ b/crates/re_log_types/src/time_point/timeline.rs @@ -1,6 +1,6 @@ use arrow2::datatypes::{DataType, TimeUnit}; -use crate::{time::TimeZone, SizeBytes, TimeRange, TimeType}; +use crate::{time::TimeZone, TimeRange, TimeType}; re_string_interner::declare_new_type!( /// The name of a timeline. Often something like `"log_time"` or `"frame_nr"`. @@ -126,7 +126,7 @@ impl Timeline { impl nohash_hasher::IsEnabled for Timeline {} -impl SizeBytes for Timeline { +impl re_types_core::SizeBytes for Timeline { #[inline] fn heap_size_bytes(&self) -> u64 { 0 diff --git a/crates/re_log_types/src/time_range.rs b/crates/re_log_types/src/time_range.rs index 9a5ed66aba95..6d7fd01bbeaf 100644 --- a/crates/re_log_types/src/time_range.rs +++ b/crates/re_log_types/src/time_range.rs @@ -1,6 +1,6 @@ use std::ops::RangeInclusive; -use crate::{SizeBytes, TimeInt, TimeReal}; +use crate::{TimeInt, TimeReal}; // ---------------------------------------------------------------------------- @@ -68,7 +68,7 @@ impl TimeRange { } } -impl SizeBytes for TimeRange { +impl re_types_core::SizeBytes for TimeRange { #[inline] fn heap_size_bytes(&self) -> u64 { 0 diff --git a/crates/re_query/Cargo.toml b/crates/re_query/Cargo.toml index 5f5af3569dcc..bb3bf34aaf82 100644 --- a/crates/re_query/Cargo.toml +++ b/crates/re_query/Cargo.toml @@ -29,6 +29,8 @@ re_arrow_store.workspace = true re_data_store.workspace = true re_format.workspace = true re_log_types.workspace = true +# NOTE: We're on our way to make this crate re_types-free, which is why we import both. +re_types_core.workspace = true re_types = { workspace = true, features = ["datagen"] } re_log.workspace = true re_tracing.workspace = true diff --git a/crates/re_query/benches/query_benchmark.rs b/crates/re_query/benches/query_benchmark.rs index 7911ed1d5857..126a9ad378a3 100644 --- a/crates/re_query/benches/query_benchmark.rs +++ b/crates/re_query/benches/query_benchmark.rs @@ -10,8 +10,8 @@ use re_query::query_archetype; use re_types::{ archetypes::Points2D, components::{Color, InstanceKey, Position2D, Text}, - Loggable as _, }; +use re_types_core::Loggable as _; // --- diff --git a/crates/re_query/src/archetype_view.rs b/crates/re_query/src/archetype_view.rs index cae2e6c1e61e..db0ef8e04f02 100644 --- a/crates/re_query/src/archetype_view.rs +++ b/crates/re_query/src/archetype_view.rs @@ -3,9 +3,10 @@ use std::{collections::BTreeMap, marker::PhantomData}; use arrow2::array::{Array, PrimitiveArray}; use re_format::arrow; use re_log_types::{DataCell, RowId}; -use re_types::{ - components::InstanceKey, Archetype, Component, ComponentName, DeserializationError, - DeserializationResult, Loggable, SerializationResult, +use re_types::components::InstanceKey; +use re_types_core::{ + Archetype, Component, ComponentName, DeserializationError, DeserializationResult, Loggable, + SerializationResult, }; use crate::QueryError; @@ -322,7 +323,7 @@ impl ArchetypeView { .next() .ok_or_else(|| DeserializationError::MissingComponent { component: C::name(), - backtrace: re_types::_Backtrace::new_unresolved(), + backtrace: re_types_core::_Backtrace::new_unresolved(), })?; let count = 1 + iter.count(); if count != 1 { diff --git a/crates/re_query/src/dataframe_util.rs b/crates/re_query/src/dataframe_util.rs index dd1d32e650ab..6d72f06cb206 100644 --- a/crates/re_query/src/dataframe_util.rs +++ b/crates/re_query/src/dataframe_util.rs @@ -4,7 +4,8 @@ use arrow2::{ }; use polars_core::prelude::*; use re_arrow_store::ArrayExt; -use re_types::{components::InstanceKey, Archetype, Component, Loggable}; +use re_types::components::InstanceKey; +use re_types_core::{Archetype, Component, Loggable}; use crate::{ArchetypeView, ComponentWithInstances, QueryError}; @@ -58,7 +59,7 @@ pub fn iter_column<'a, C: Component + 'a>( pub fn df_builder1<'a, C0>(c0: &'a [Option]) -> crate::Result where - C0: re_types::Component + Clone + 'a, + C0: re_types_core::Component + Clone + 'a, &'a C0: Into<::std::borrow::Cow<'a, C0>>, { let array0 = C0::to_arrow_opt(c0.iter().map(|c| c.as_ref()))?; @@ -73,8 +74,8 @@ pub fn df_builder2<'a, C0, C1>( c1: &'a [Option], ) -> crate::Result where - C0: re_types::Component + Clone + 'a, - C1: re_types::Component + Clone + 'a, + C0: re_types_core::Component + Clone + 'a, + C1: re_types_core::Component + Clone + 'a, &'a C0: Into<::std::borrow::Cow<'a, C0>>, &'a C1: Into<::std::borrow::Cow<'a, C1>>, { @@ -93,9 +94,9 @@ pub fn df_builder3<'a, C0, C1, C2>( c2: &'a [Option], ) -> crate::Result where - C0: re_types::Component + Clone + 'a, - C1: re_types::Component + Clone + 'a, - C2: re_types::Component + Clone + 'a, + C0: re_types_core::Component + Clone + 'a, + C1: re_types_core::Component + Clone + 'a, + C2: re_types_core::Component + Clone + 'a, &'a C0: Into<::std::borrow::Cow<'a, C0>>, &'a C1: Into<::std::borrow::Cow<'a, C1>>, &'a C2: Into<::std::borrow::Cow<'a, C2>>, @@ -134,7 +135,10 @@ impl ComponentWithInstances { } impl ArchetypeView { - pub fn as_df1<'a, C1: re_types::Component + Clone + Into<::std::borrow::Cow<'a, C1>> + 'a>( + pub fn as_df1< + 'a, + C1: re_types_core::Component + Clone + Into<::std::borrow::Cow<'a, C1>> + 'a, + >( &self, ) -> crate::Result { let array0 = InstanceKey::to_arrow(self.iter_instance_keys())?; @@ -151,8 +155,8 @@ impl ArchetypeView { pub fn as_df2< 'a, - C1: re_types::Component + Clone + Into<::std::borrow::Cow<'a, C1>> + 'a, - C2: re_types::Component + Clone + Into<::std::borrow::Cow<'a, C2>> + 'a, + C1: re_types_core::Component + Clone + Into<::std::borrow::Cow<'a, C1>> + 'a, + C2: re_types_core::Component + Clone + Into<::std::borrow::Cow<'a, C2>> + 'a, >( &self, ) -> crate::Result { diff --git a/crates/re_query/src/lib.rs b/crates/re_query/src/lib.rs index 00c0c5dfeb3f..c13392bb41dc 100644 --- a/crates/re_query/src/lib.rs +++ b/crates/re_query/src/lib.rs @@ -29,28 +29,28 @@ pub enum QueryError { BadAccess, #[error("Could not find primary component: {0}")] - PrimaryNotFound(re_types::ComponentName), + PrimaryNotFound(re_types_core::ComponentName), #[error("Could not find required component: {0}")] - RequiredComponentNotFound(re_log_types::ComponentName), + RequiredComponentNotFound(re_types_core::ComponentName), #[error("Could not find component")] ComponentNotFound, #[error("Tried to access component of type '{actual:?}' using component '{requested:?}'")] TypeMismatch { - actual: re_types::ComponentName, - requested: re_types::ComponentName, + actual: re_types_core::ComponentName, + requested: re_types_core::ComponentName, }, #[error("Error with one or more the underlying data cells: {0}")] DataCell(#[from] re_log_types::DataCellError), #[error("Error deserializing: {0}")] - DeserializationError(#[from] re_types::DeserializationError), + DeserializationError(#[from] re_types_core::DeserializationError), #[error("Error serializing: {0}")] - SerializationError(#[from] re_types::SerializationError), + SerializationError(#[from] re_types_core::SerializationError), #[error("Error converting arrow data: {0}")] ArrowError(#[from] arrow2::error::Error), diff --git a/crates/re_query/src/query.rs b/crates/re_query/src/query.rs index 441e32805dc6..3b6bbc552e7b 100644 --- a/crates/re_query/src/query.rs +++ b/crates/re_query/src/query.rs @@ -1,6 +1,7 @@ use re_arrow_store::{DataStore, LatestAtQuery}; use re_log_types::{DataRow, EntityPath, RowId}; -use re_types::{components::InstanceKey, Archetype, ComponentName, Loggable}; +use re_types::components::InstanceKey; +use re_types_core::{Archetype, ComponentName, Loggable}; use crate::{ArchetypeView, ComponentWithInstances, QueryError}; @@ -76,7 +77,7 @@ pub fn get_component_with_instances( /// ``` /// # use re_arrow_store::LatestAtQuery; /// # use re_log_types::Timeline; -/// # use re_types::Component; +/// # use re_types_core::Component; /// # use re_types::components::{Position2D, Color}; /// # use re_types::archetypes::Points2D; /// # let store = re_query::__populate_example_store(); diff --git a/crates/re_query/src/range.rs b/crates/re_query/src/range.rs index 8e098e7fa8ec..859528e4b943 100644 --- a/crates/re_query/src/range.rs +++ b/crates/re_query/src/range.rs @@ -1,7 +1,7 @@ use itertools::Itertools as _; use re_arrow_store::{DataStore, LatestAtQuery, RangeQuery, TimeInt}; use re_log_types::EntityPath; -use re_types::{Archetype, ComponentName}; +use re_types_core::{Archetype, ComponentName}; use crate::{get_component_with_instances, ArchetypeView, ComponentWithInstances}; diff --git a/crates/re_query/src/util.rs b/crates/re_query/src/util.rs index 350f0a87c4ce..1d1da7a755c8 100644 --- a/crates/re_query/src/util.rs +++ b/crates/re_query/src/util.rs @@ -1,7 +1,7 @@ use re_arrow_store::{DataStore, LatestAtQuery, RangeQuery, TimeInt, TimeRange, Timeline}; use re_data_store::ExtraQueryHistory; use re_log_types::EntityPath; -use re_types::Archetype; +use re_types_core::Archetype; use crate::{query_archetype, range::range_archetype, ArchetypeView}; diff --git a/crates/re_query/tests/archetype_query_tests.rs b/crates/re_query/tests/archetype_query_tests.rs index f2e6ba7a9629..7ed29d8e89cb 100644 --- a/crates/re_query/tests/archetype_query_tests.rs +++ b/crates/re_query/tests/archetype_query_tests.rs @@ -6,8 +6,8 @@ use re_query::query_archetype; use re_types::{ archetypes::Points2D, components::{Color, InstanceKey, Position2D}, - Loggable, }; +use re_types_core::Loggable as _; #[test] fn simple_query() { diff --git a/crates/re_query/tests/archetype_range_tests.rs b/crates/re_query/tests/archetype_range_tests.rs index ed7195a61dcd..e34a7b39791c 100644 --- a/crates/re_query/tests/archetype_range_tests.rs +++ b/crates/re_query/tests/archetype_range_tests.rs @@ -6,8 +6,8 @@ use re_query::range_archetype; use re_types::{ archetypes::Points2D, components::{Color, InstanceKey, Position2D}, - Loggable as _, }; +use re_types_core::Loggable as _; #[test] fn simple_range() { diff --git a/crates/re_sdk/Cargo.toml b/crates/re_sdk/Cargo.toml index e17820fca6bd..b8f9d5765585 100644 --- a/crates/re_sdk/Cargo.toml +++ b/crates/re_sdk/Cargo.toml @@ -61,6 +61,7 @@ re_log_types.workspace = true re_log.workspace = true re_memory.workspace = true re_sdk_comms = { workspace = true, features = ["client"] } +re_types_core.workspace = true re_types = { workspace = true, features = ["ecolor", "glam"] } ahash.workspace = true diff --git a/crates/re_sdk/src/lib.rs b/crates/re_sdk/src/lib.rs index c5bfafe827b7..12545ebdd09d 100644 --- a/crates/re_sdk/src/lib.rs +++ b/crates/re_sdk/src/lib.rs @@ -90,11 +90,11 @@ pub mod coordinates { pub use re_types::view_coordinates::{Axis3, Handedness, Sign, SignedAxis3}; } -pub use re_types::{ - archetypes, components, datatypes, Archetype, ArchetypeName, AsComponents, Component, - ComponentBatch, ComponentName, Datatype, DatatypeBatch, DatatypeName, - GenericIndicatorComponent, Loggable, LoggableBatch, MaybeOwnedComponentBatch, - NamedIndicatorComponent, +pub use re_types::{archetypes, components, datatypes}; +pub use re_types_core::{ + Archetype, ArchetypeName, AsComponents, Component, ComponentBatch, ComponentName, Datatype, + DatatypeBatch, DatatypeName, GenericIndicatorComponent, Loggable, LoggableBatch, + MaybeOwnedComponentBatch, NamedIndicatorComponent, }; mod prelude { diff --git a/crates/re_sdk/src/recording_stream.rs b/crates/re_sdk/src/recording_stream.rs index 7fd190910f7c..af7b0f035728 100644 --- a/crates/re_sdk/src/recording_stream.rs +++ b/crates/re_sdk/src/recording_stream.rs @@ -9,7 +9,8 @@ use re_log_types::{ DataTableBatcherConfig, DataTableBatcherError, EntityPath, LogMsg, RowId, StoreId, StoreInfo, StoreKind, StoreSource, Time, TimeInt, TimePoint, TimeType, Timeline, TimelineName, }; -use re_types::{components::InstanceKey, AsComponents, ComponentBatch, SerializationError}; +use re_types::components::InstanceKey; +use re_types_core::{AsComponents, ComponentBatch, SerializationError}; #[cfg(feature = "web_viewer")] use re_web_viewer_server::WebViewerServerPort; diff --git a/crates/re_sdk_comms/Cargo.toml b/crates/re_sdk_comms/Cargo.toml index 9289d41c2fb0..d50bd7b4fc99 100644 --- a/crates/re_sdk_comms/Cargo.toml +++ b/crates/re_sdk_comms/Cargo.toml @@ -18,10 +18,10 @@ all-features = true [features] ## Enable the client (SDK-side). -client = [] +client = ["re_log_encoding/encoder"] ## Enable the server. -server = [] +server = ["re_log_encoding/decoder"] [dependencies] @@ -35,4 +35,4 @@ crossbeam.workspace = true document-features.workspace = true rand = { workspace = true, features = ["std", "std_rng", "small_rng"] } thiserror.workspace = true -tokio = { workspace = true, features = ["io-util", "net"] } +tokio = { workspace = true, features = ["io-util", "net", "rt"] } diff --git a/crates/re_string_interner/Cargo.toml b/crates/re_string_interner/Cargo.toml index 66b5633571d0..49cf49a90b5e 100644 --- a/crates/re_string_interner/Cargo.toml +++ b/crates/re_string_interner/Cargo.toml @@ -16,11 +16,15 @@ version.workspace = true all-features = true +[features] +serde = ["dep:serde"] + + [dependencies] ahash.workspace = true nohash-hasher = "0.2" once_cell.workspace = true parking_lot.workspace = true -# Optional dependencies: -serde = { version = "1", optional = true } +# Optional dependencies +serde = { workspace = true, optional = true } diff --git a/crates/re_string_interner/src/lib.rs b/crates/re_string_interner/src/lib.rs index 7ccf97af9ebb..dd6188a7b3ec 100644 --- a/crates/re_string_interner/src/lib.rs +++ b/crates/re_string_interner/src/lib.rs @@ -10,6 +10,9 @@ pub mod external { pub use nohash_hasher; + + #[cfg(feature = "serde")] + pub use serde; } /// Fast but high quality string hash @@ -200,7 +203,10 @@ macro_rules! declare_new_type { ) => { $(#[$meta])* #[derive(Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] - #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] + #[cfg_attr( + feature = "serde", + derive(serde::Deserialize, serde::Serialize), + )] pub struct $StructName($crate::InternedString); impl $StructName { diff --git a/crates/re_tuid/Cargo.toml b/crates/re_tuid/Cargo.toml index 0b423be02549..f9f51933103e 100644 --- a/crates/re_tuid/Cargo.toml +++ b/crates/re_tuid/Cargo.toml @@ -20,10 +20,10 @@ all-features = true default = [] ## Enable (de)serialization using Arrow. -arrow = ["dep:re_types", "dep:arrow2", "dep:thiserror"] +arrow = ["dep:re_types_core", "dep:arrow2"] ## Enable (de)serialization using serde. -serde = ["dep:serde"] +serde = ["dep:serde", "re_types_core?/serde"] [dependencies] @@ -34,11 +34,10 @@ web-time.workspace = true # Optional dependencies -re_types = { workspace = true, optional = true } +re_types_core = { workspace = true, optional = true } arrow2 = { workspace = true, optional = true } serde = { version = "1", features = ["derive"], optional = true } -thiserror = { workspace = true, optional = true } [dev-dependencies] criterion = "0.5" diff --git a/crates/re_tuid/benches/bench_tuid.rs b/crates/re_tuid/benches/bench_tuid.rs index 86c2566ebe2d..b37b92dcf4b6 100644 --- a/crates/re_tuid/benches/bench_tuid.rs +++ b/crates/re_tuid/benches/bench_tuid.rs @@ -11,7 +11,7 @@ fn bench_tuid(c: &mut Criterion) { #[cfg(feature = "arrow")] fn bench_arrow(c: &mut Criterion) { use arrow2::array::Array; - use re_types::Loggable as _; + use re_types_core::Loggable as _; for elem_count in [1, 1000] { { diff --git a/crates/re_tuid/src/arrow.rs b/crates/re_tuid/src/arrow.rs index 6137965e4437..5af31cd55190 100644 --- a/crates/re_tuid/src/arrow.rs +++ b/crates/re_tuid/src/arrow.rs @@ -2,7 +2,7 @@ use arrow2::{ array::{StructArray, UInt64Array}, datatypes::{DataType, Field}, }; -use re_types::Loggable; +use re_types_core::Loggable; use crate::Tuid; @@ -23,7 +23,7 @@ impl<'a> From<&'a Tuid> for ::std::borrow::Cow<'a, Tuid> { } impl Loggable for Tuid { - type Name = re_types::ComponentName; + type Name = re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -40,11 +40,11 @@ impl Loggable for Tuid { fn to_arrow_opt<'a>( _data: impl IntoIterator>>>, - ) -> re_types::SerializationResult> + ) -> re_types_core::SerializationResult> where Self: 'a, { - Err(re_types::SerializationError::not_implemented( + Err(re_types_core::SerializationError::not_implemented( Self::name(), "TUIDs are never nullable, use `to_arrow()` instead", )) @@ -53,7 +53,7 @@ impl Loggable for Tuid { #[inline] fn to_arrow<'a>( data: impl IntoIterator>>, - ) -> re_types::SerializationResult> + ) -> re_types_core::SerializationResult> where Self: 'a, { @@ -75,11 +75,11 @@ impl Loggable for Tuid { fn from_arrow( array: &dyn ::arrow2::array::Array, - ) -> re_types::DeserializationResult> { + ) -> re_types_core::DeserializationResult> { let expected_datatype = Self::arrow_datatype(); let actual_datatype = array.data_type().to_logical_type(); if actual_datatype != &expected_datatype { - return Err(re_types::DeserializationError::datatype_mismatch( + return Err(re_types_core::DeserializationError::datatype_mismatch( expected_datatype, actual_datatype.clone(), )); @@ -119,7 +119,7 @@ impl Loggable for Tuid { if time_ns_buffer.len() != inc_buffer.len() { return Err( - re_types::DeserializationError::mismatched_struct_field_lengths( + re_types_core::DeserializationError::mismatched_struct_field_lengths( "time_ns", time_ns_buffer.len(), "inc", @@ -137,7 +137,7 @@ impl Loggable for Tuid { } } -/// Implements [`re_types::Component`] for any given type that is a simple wrapper +/// Implements [`re_types_core::Component`] for any given type that is a simple wrapper /// (newtype) around a [`Tuid`]. /// /// Usage: @@ -161,8 +161,8 @@ macro_rules! delegate_arrow_tuid { } } - impl ::re_types::Loggable for $typ { - type Name = ::re_types::ComponentName; + impl ::re_types_core::Loggable for $typ { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -177,11 +177,11 @@ macro_rules! delegate_arrow_tuid { #[inline] fn to_arrow_opt<'a>( values: impl IntoIterator>>>, - ) -> re_types::SerializationResult> + ) -> re_types_core::SerializationResult> where Self: 'a, { - Err(re_types::SerializationError::not_implemented( + Err(re_types_core::SerializationError::not_implemented( Self::name(), "TUIDs are never nullable, use `to_arrow()` instead", )) @@ -190,12 +190,12 @@ macro_rules! delegate_arrow_tuid { #[inline] fn to_arrow<'a>( values: impl IntoIterator>>, - ) -> re_types::SerializationResult> { + ) -> re_types_core::SerializationResult> { let values = values.into_iter().map(|value| { let value: ::std::borrow::Cow<'a, Self> = value.into(); value.into_owned() }); - <$crate::Tuid as ::re_types::Loggable>::to_arrow( + <$crate::Tuid as ::re_types_core::Loggable>::to_arrow( values.into_iter().map(|$typ(tuid)| tuid), ) } @@ -203,11 +203,13 @@ macro_rules! delegate_arrow_tuid { #[inline] fn from_arrow( array: &dyn arrow2::array::Array, - ) -> re_types::DeserializationResult> { - Ok(<$crate::Tuid as ::re_types::Loggable>::from_arrow(array)? - .into_iter() - .map(|tuid| Self(tuid)) - .collect()) + ) -> re_types_core::DeserializationResult> { + Ok( + <$crate::Tuid as ::re_types_core::Loggable>::from_arrow(array)? + .into_iter() + .map(|tuid| Self(tuid)) + .collect(), + ) } } }; diff --git a/crates/re_tuid/src/lib.rs b/crates/re_tuid/src/lib.rs index 169f5ac152ef..c2f96657746f 100644 --- a/crates/re_tuid/src/lib.rs +++ b/crates/re_tuid/src/lib.rs @@ -22,7 +22,7 @@ pub mod arrow; pub mod external { #[cfg(feature = "arrow")] - pub use re_types; + pub use re_types_core; } impl std::fmt::Display for Tuid { diff --git a/crates/re_types/Cargo.toml b/crates/re_types/Cargo.toml index c3abfb5618b4..3d0c35bba104 100644 --- a/crates/re_types/Cargo.toml +++ b/crates/re_types/Cargo.toml @@ -39,7 +39,7 @@ glam = ["dep:glam"] image = ["dep:ecolor", "dep:image", "dep:zune-core", "dep:zune-jpeg"] ## Enable (de)serialization using serde. -serde = ["dep:serde", "re_string_interner/serde"] +serde = ["dep:serde"] ## Include testing archetypes/components/datatypes into the crate. ## Only useful for testing purposes. @@ -48,10 +48,9 @@ testing = [] [dependencies] # Rerun -re_error.workspace = true re_log.workspace = true -re_string_interner.workspace = true re_tracing.workspace = true +re_types_core.workspace = true # External anyhow.workspace = true @@ -61,7 +60,6 @@ arrow2 = { workspace = true, features = [ "io_print", "compute_concatenate", ] } -backtrace.workspace = true bytemuck = { workspace = true, features = ["derive", "extern_crate_alloc"] } document-features.workspace = true infer.workspace = true @@ -101,6 +99,10 @@ re_types_builder.workspace = true # External rayon.workspace = true +# `machete` is not a fan of `build-dependencies`. +[package.metadata.cargo-machete] +ignored = ["rayon", "re_build_tools", "re_types_builder"] + [[test]] name = "fuzzy" diff --git a/crates/re_types/src/archetypes/annotation_context.rs b/crates/re_types/src/archetypes/annotation_context.rs index 4fb66bcc9be2..8de2b4955d49 100644 --- a/crates/re_types/src/archetypes/annotation_context.rs +++ b/crates/re_types/src/archetypes/annotation_context.rs @@ -75,16 +75,16 @@ pub struct AnnotationContext { pub context: crate::components::AnnotationContext, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.AnnotationContext".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.AnnotationContextIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.AnnotationContext".into(), @@ -97,40 +97,40 @@ impl AnnotationContext { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`AnnotationContext`] [`crate::Archetype`] -pub type AnnotationContextIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`AnnotationContext`] [`::re_types_core::Archetype`] +pub type AnnotationContextIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for AnnotationContext { +impl ::re_types_core::Archetype for AnnotationContext { type Indicator = AnnotationContextIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.AnnotationContext".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: AnnotationContextIndicator = AnnotationContextIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -139,9 +139,9 @@ impl crate::Archetype for AnnotationContext { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -149,27 +149,27 @@ impl crate::Archetype for AnnotationContext { let context = { let array = arrays_by_name .get("rerun.components.AnnotationContext") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.AnnotationContext#context")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.AnnotationContext#context")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.AnnotationContext#context")? }; Ok(Self { context }) } } -impl crate::AsComponents for AnnotationContext { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for AnnotationContext { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.context as &dyn crate::ComponentBatch).into()), + Some((&self.context as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/arrows3d.rs b/crates/re_types/src/archetypes/arrows3d.rs index 8b3717efc703..85f9cef440f8 100644 --- a/crates/re_types/src/archetypes/arrows3d.rs +++ b/crates/re_types/src/archetypes/arrows3d.rs @@ -91,10 +91,10 @@ pub struct Arrows3D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Vector3D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Arrows3DIndicator".into(), @@ -102,7 +102,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 5usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -113,7 +113,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 8usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 8usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Vector3D".into(), @@ -131,40 +131,40 @@ impl Arrows3D { pub const NUM_COMPONENTS: usize = 8usize; } -/// Indicator component for the [`Arrows3D`] [`crate::Archetype`] -pub type Arrows3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Arrows3D`] [`::re_types_core::Archetype`] +pub type Arrows3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Arrows3D { +impl ::re_types_core::Archetype for Arrows3D { type Indicator = Arrows3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Arrows3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Arrows3DIndicator = Arrows3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -173,9 +173,9 @@ impl crate::Archetype for Arrows3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -183,13 +183,13 @@ impl crate::Archetype for Arrows3D { let vectors = { let array = arrays_by_name .get("rerun.components.Vector3D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Arrows3D#vectors")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#vectors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#vectors")? }; let origins = if let Some(array) = arrays_by_name.get("rerun.components.Position3D") { @@ -197,8 +197,8 @@ impl crate::Archetype for Arrows3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#origins")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#origins")? }) } else { @@ -209,8 +209,8 @@ impl crate::Archetype for Arrows3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#radii")? }) } else { @@ -221,8 +221,8 @@ impl crate::Archetype for Arrows3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#colors")? }) } else { @@ -233,8 +233,8 @@ impl crate::Archetype for Arrows3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#labels")? }) } else { @@ -245,8 +245,8 @@ impl crate::Archetype for Arrows3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#class_ids")? }) } else { @@ -258,8 +258,8 @@ impl crate::Archetype for Arrows3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Arrows3D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Arrows3D#instance_keys")? }) } else { @@ -277,31 +277,31 @@ impl crate::Archetype for Arrows3D { } } -impl crate::AsComponents for Arrows3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Arrows3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.vectors as &dyn crate::ComponentBatch).into()), + Some((&self.vectors as &dyn ::re_types_core::ComponentBatch).into()), self.origins .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/asset3d.rs b/crates/re_types/src/archetypes/asset3d.rs index 10ba5d416cda..2ef168d503a0 100644 --- a/crates/re_types/src/archetypes/asset3d.rs +++ b/crates/re_types/src/archetypes/asset3d.rs @@ -72,10 +72,10 @@ pub struct Asset3D { pub transform: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Blob".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Asset3DIndicator".into(), @@ -83,7 +83,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.InstanceKey".into(), @@ -91,7 +91,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 5usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Blob".into(), @@ -106,40 +106,40 @@ impl Asset3D { pub const NUM_COMPONENTS: usize = 5usize; } -/// Indicator component for the [`Asset3D`] [`crate::Archetype`] -pub type Asset3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Asset3D`] [`::re_types_core::Archetype`] +pub type Asset3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Asset3D { +impl ::re_types_core::Archetype for Asset3D { type Indicator = Asset3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Asset3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Asset3DIndicator = Asset3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -148,9 +148,9 @@ impl crate::Archetype for Asset3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -158,14 +158,14 @@ impl crate::Archetype for Asset3D { let blob = { let array = arrays_by_name .get("rerun.components.Blob") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#blob")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Asset3D#blob")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#blob")? }; let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { @@ -175,7 +175,7 @@ impl crate::Archetype for Asset3D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#media_type")? }) } else { @@ -189,7 +189,7 @@ impl crate::Archetype for Asset3D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Asset3D#transform")? }) } else { @@ -203,19 +203,19 @@ impl crate::Archetype for Asset3D { } } -impl crate::AsComponents for Asset3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Asset3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.blob as &dyn crate::ComponentBatch).into()), + Some((&self.blob as &dyn ::re_types_core::ComponentBatch).into()), self.media_type .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.transform .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/bar_chart.rs b/crates/re_types/src/archetypes/bar_chart.rs index 7fa353cb565e..4003d75029f2 100644 --- a/crates/re_types/src/archetypes/bar_chart.rs +++ b/crates/re_types/src/archetypes/bar_chart.rs @@ -51,16 +51,16 @@ pub struct BarChart { pub values: crate::components::TensorData, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TensorData".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.BarChartIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.TensorData".into(), @@ -73,40 +73,40 @@ impl BarChart { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`BarChart`] [`crate::Archetype`] -pub type BarChartIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`BarChart`] [`::re_types_core::Archetype`] +pub type BarChartIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for BarChart { +impl ::re_types_core::Archetype for BarChart { type Indicator = BarChartIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.BarChart".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: BarChartIndicator = BarChartIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -115,9 +115,9 @@ impl crate::Archetype for BarChart { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -125,27 +125,27 @@ impl crate::Archetype for BarChart { let values = { let array = arrays_by_name .get("rerun.components.TensorData") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.BarChart#values")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.BarChart#values")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.BarChart#values")? }; Ok(Self { values }) } } -impl crate::AsComponents for BarChart { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for BarChart { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.values as &dyn crate::ComponentBatch).into()), + Some((&self.values as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/boxes2d.rs b/crates/re_types/src/archetypes/boxes2d.rs index 466c5071a6e9..f2d5846e2e57 100644 --- a/crates/re_types/src/archetypes/boxes2d.rs +++ b/crates/re_types/src/archetypes/boxes2d.rs @@ -79,10 +79,10 @@ pub struct Boxes2D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.HalfSizes2D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Boxes2DIndicator".into(), @@ -91,7 +91,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 5usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -102,7 +102,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 9usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 9usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.HalfSizes2D".into(), @@ -121,40 +121,40 @@ impl Boxes2D { pub const NUM_COMPONENTS: usize = 9usize; } -/// Indicator component for the [`Boxes2D`] [`crate::Archetype`] -pub type Boxes2DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Boxes2D`] [`::re_types_core::Archetype`] +pub type Boxes2DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Boxes2D { +impl ::re_types_core::Archetype for Boxes2D { type Indicator = Boxes2DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Boxes2D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Boxes2DIndicator = Boxes2DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -163,9 +163,9 @@ impl crate::Archetype for Boxes2D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -173,13 +173,13 @@ impl crate::Archetype for Boxes2D { let half_sizes = { let array = arrays_by_name .get("rerun.components.HalfSizes2D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes2D#half_sizes")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#half_sizes")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#half_sizes")? }; let centers = if let Some(array) = arrays_by_name.get("rerun.components.Position2D") { @@ -187,8 +187,8 @@ impl crate::Archetype for Boxes2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#centers")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#centers")? }) } else { @@ -199,8 +199,8 @@ impl crate::Archetype for Boxes2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#colors")? }) } else { @@ -211,8 +211,8 @@ impl crate::Archetype for Boxes2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#radii")? }) } else { @@ -223,8 +223,8 @@ impl crate::Archetype for Boxes2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#labels")? }) } else { @@ -237,7 +237,7 @@ impl crate::Archetype for Boxes2D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes2D#draw_order")? }) } else { @@ -248,8 +248,8 @@ impl crate::Archetype for Boxes2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#class_ids")? }) } else { @@ -261,8 +261,8 @@ impl crate::Archetype for Boxes2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes2D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes2D#instance_keys")? }) } else { @@ -281,34 +281,34 @@ impl crate::Archetype for Boxes2D { } } -impl crate::AsComponents for Boxes2D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Boxes2D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.half_sizes as &dyn crate::ComponentBatch).into()), + Some((&self.half_sizes as &dyn ::re_types_core::ComponentBatch).into()), self.centers .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.draw_order .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/boxes3d.rs b/crates/re_types/src/archetypes/boxes3d.rs index 997bb32ad7bd..678a933c7173 100644 --- a/crates/re_types/src/archetypes/boxes3d.rs +++ b/crates/re_types/src/archetypes/boxes3d.rs @@ -86,10 +86,10 @@ pub struct Boxes3D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.HalfSizes3D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Boxes3DIndicator".into(), @@ -99,7 +99,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -109,7 +109,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 9usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 9usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.HalfSizes3D".into(), @@ -128,40 +128,40 @@ impl Boxes3D { pub const NUM_COMPONENTS: usize = 9usize; } -/// Indicator component for the [`Boxes3D`] [`crate::Archetype`] -pub type Boxes3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Boxes3D`] [`::re_types_core::Archetype`] +pub type Boxes3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Boxes3D { +impl ::re_types_core::Archetype for Boxes3D { type Indicator = Boxes3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Boxes3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Boxes3DIndicator = Boxes3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -170,9 +170,9 @@ impl crate::Archetype for Boxes3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -180,13 +180,13 @@ impl crate::Archetype for Boxes3D { let half_sizes = { let array = arrays_by_name .get("rerun.components.HalfSizes3D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Boxes3D#half_sizes")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#half_sizes")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#half_sizes")? }; let centers = if let Some(array) = arrays_by_name.get("rerun.components.Position3D") { @@ -194,8 +194,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#centers")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#centers")? }) } else { @@ -206,8 +206,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#rotations")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#rotations")? }) } else { @@ -218,8 +218,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#colors")? }) } else { @@ -230,8 +230,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#radii")? }) } else { @@ -242,8 +242,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#labels")? }) } else { @@ -254,8 +254,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#class_ids")? }) } else { @@ -267,8 +267,8 @@ impl crate::Archetype for Boxes3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Boxes3D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Boxes3D#instance_keys")? }) } else { @@ -287,34 +287,34 @@ impl crate::Archetype for Boxes3D { } } -impl crate::AsComponents for Boxes3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Boxes3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.half_sizes as &dyn crate::ComponentBatch).into()), + Some((&self.half_sizes as &dyn ::re_types_core::ComponentBatch).into()), self.centers .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.rotations .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/clear.rs b/crates/re_types/src/archetypes/clear.rs index deca34280f99..ebcd07c82a82 100644 --- a/crates/re_types/src/archetypes/clear.rs +++ b/crates/re_types/src/archetypes/clear.rs @@ -68,16 +68,16 @@ pub struct Clear { pub is_recursive: crate::components::ClearIsRecursive, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.ClearIsRecursive".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.ClearIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClearIsRecursive".into(), @@ -90,40 +90,40 @@ impl Clear { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`Clear`] [`crate::Archetype`] -pub type ClearIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Clear`] [`::re_types_core::Archetype`] +pub type ClearIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Clear { +impl ::re_types_core::Archetype for Clear { type Indicator = ClearIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Clear".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: ClearIndicator = ClearIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -132,9 +132,9 @@ impl crate::Archetype for Clear { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -142,27 +142,27 @@ impl crate::Archetype for Clear { let is_recursive = { let array = arrays_by_name .get("rerun.components.ClearIsRecursive") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Clear#is_recursive")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Clear#is_recursive")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Clear#is_recursive")? }; Ok(Self { is_recursive }) } } -impl crate::AsComponents for Clear { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Clear { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.is_recursive as &dyn crate::ComponentBatch).into()), + Some((&self.is_recursive as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/depth_image.rs b/crates/re_types/src/archetypes/depth_image.rs index f8a6cf705535..ef5893ed3208 100644 --- a/crates/re_types/src/archetypes/depth_image.rs +++ b/crates/re_types/src/archetypes/depth_image.rs @@ -77,13 +77,13 @@ pub struct DepthImage { pub draw_order: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TensorData".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.DepthImageIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.DepthMeter".into(), @@ -92,7 +92,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 5usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.TensorData".into(), @@ -107,40 +107,40 @@ impl DepthImage { pub const NUM_COMPONENTS: usize = 5usize; } -/// Indicator component for the [`DepthImage`] [`crate::Archetype`] -pub type DepthImageIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`DepthImage`] [`::re_types_core::Archetype`] +pub type DepthImageIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for DepthImage { +impl ::re_types_core::Archetype for DepthImage { type Indicator = DepthImageIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.DepthImage".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: DepthImageIndicator = DepthImageIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -149,9 +149,9 @@ impl crate::Archetype for DepthImage { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -159,14 +159,14 @@ impl crate::Archetype for DepthImage { let data = { let array = arrays_by_name .get("rerun.components.TensorData") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#data")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DepthImage#data")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#data")? }; let meter = if let Some(array) = arrays_by_name.get("rerun.components.DepthMeter") { @@ -176,7 +176,7 @@ impl crate::Archetype for DepthImage { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#meter")? }) } else { @@ -189,7 +189,7 @@ impl crate::Archetype for DepthImage { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.DepthImage#draw_order")? }) } else { @@ -203,19 +203,19 @@ impl crate::Archetype for DepthImage { } } -impl crate::AsComponents for DepthImage { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for DepthImage { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.data as &dyn crate::ComponentBatch).into()), + Some((&self.data as &dyn ::re_types_core::ComponentBatch).into()), self.meter .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.draw_order .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/depth_image_ext.rs b/crates/re_types/src/archetypes/depth_image_ext.rs index f75f86423afa..50fbfc1f868e 100644 --- a/crates/re_types/src/archetypes/depth_image_ext.rs +++ b/crates/re_types/src/archetypes/depth_image_ext.rs @@ -38,7 +38,7 @@ impl DepthImage { } } -fn assign_if_none(name: &mut Option, new_name: &str) { +fn assign_if_none(name: &mut Option<::re_types_core::ArrowString>, new_name: &str) { if name.is_none() { *name = Some(new_name.into()); } diff --git a/crates/re_types/src/archetypes/disconnected_space.rs b/crates/re_types/src/archetypes/disconnected_space.rs index 90bde42a6da8..7efe8049a999 100644 --- a/crates/re_types/src/archetypes/disconnected_space.rs +++ b/crates/re_types/src/archetypes/disconnected_space.rs @@ -66,16 +66,16 @@ pub struct DisconnectedSpace { pub disconnected_space: crate::components::DisconnectedSpace, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.DisconnectedSpace".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.DisconnectedSpaceIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.DisconnectedSpace".into(), @@ -88,40 +88,40 @@ impl DisconnectedSpace { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`DisconnectedSpace`] [`crate::Archetype`] -pub type DisconnectedSpaceIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`DisconnectedSpace`] [`::re_types_core::Archetype`] +pub type DisconnectedSpaceIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for DisconnectedSpace { +impl ::re_types_core::Archetype for DisconnectedSpace { type Indicator = DisconnectedSpaceIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.DisconnectedSpace".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: DisconnectedSpaceIndicator = DisconnectedSpaceIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -130,9 +130,9 @@ impl crate::Archetype for DisconnectedSpace { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -140,27 +140,27 @@ impl crate::Archetype for DisconnectedSpace { let disconnected_space = { let array = arrays_by_name .get("rerun.components.DisconnectedSpace") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.DisconnectedSpace#disconnected_space")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.DisconnectedSpace#disconnected_space")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.DisconnectedSpace#disconnected_space")? }; Ok(Self { disconnected_space }) } } -impl crate::AsComponents for DisconnectedSpace { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for DisconnectedSpace { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.disconnected_space as &dyn crate::ComponentBatch).into()), + Some((&self.disconnected_space as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/image.rs b/crates/re_types/src/archetypes/image.rs index bdaeb5bbaf76..f2da36aab4a1 100644 --- a/crates/re_types/src/archetypes/image.rs +++ b/crates/re_types/src/archetypes/image.rs @@ -67,13 +67,13 @@ pub struct Image { pub draw_order: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TensorData".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.ImageIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.DrawOrder".into(), @@ -81,7 +81,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.TensorData".into(), @@ -95,40 +95,40 @@ impl Image { pub const NUM_COMPONENTS: usize = 4usize; } -/// Indicator component for the [`Image`] [`crate::Archetype`] -pub type ImageIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Image`] [`::re_types_core::Archetype`] +pub type ImageIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Image { +impl ::re_types_core::Archetype for Image { type Indicator = ImageIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Image".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: ImageIndicator = ImageIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -137,9 +137,9 @@ impl crate::Archetype for Image { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -147,14 +147,14 @@ impl crate::Archetype for Image { let data = { let array = arrays_by_name .get("rerun.components.TensorData") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Image#data")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Image#data")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Image#data")? }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { @@ -164,7 +164,7 @@ impl crate::Archetype for Image { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Image#draw_order")? }) } else { @@ -174,16 +174,16 @@ impl crate::Archetype for Image { } } -impl crate::AsComponents for Image { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Image { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.data as &dyn crate::ComponentBatch).into()), + Some((&self.data as &dyn ::re_types_core::ComponentBatch).into()), self.draw_order .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/image_ext.rs b/crates/re_types/src/archetypes/image_ext.rs index fe0fcd3e4d10..45f2bbd65ee2 100644 --- a/crates/re_types/src/archetypes/image_ext.rs +++ b/crates/re_types/src/archetypes/image_ext.rs @@ -45,7 +45,7 @@ impl Image { } } -fn assign_if_none(name: &mut Option, new_name: &str) { +fn assign_if_none(name: &mut Option<::re_types_core::ArrowString>, new_name: &str) { if name.is_none() { *name = Some(new_name.into()); } diff --git a/crates/re_types/src/archetypes/line_strips2d.rs b/crates/re_types/src/archetypes/line_strips2d.rs index c442c021c649..22627a4efb53 100644 --- a/crates/re_types/src/archetypes/line_strips2d.rs +++ b/crates/re_types/src/archetypes/line_strips2d.rs @@ -84,10 +84,10 @@ pub struct LineStrips2D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.LineStrip2D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Color".into(), @@ -96,7 +96,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -106,7 +106,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 8usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 8usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.LineStrip2D".into(), @@ -124,40 +124,40 @@ impl LineStrips2D { pub const NUM_COMPONENTS: usize = 8usize; } -/// Indicator component for the [`LineStrips2D`] [`crate::Archetype`] -pub type LineStrips2DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`LineStrips2D`] [`::re_types_core::Archetype`] +pub type LineStrips2DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for LineStrips2D { +impl ::re_types_core::Archetype for LineStrips2D { type Indicator = LineStrips2DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.LineStrips2D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: LineStrips2DIndicator = LineStrips2DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -166,9 +166,9 @@ impl crate::Archetype for LineStrips2D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -176,13 +176,13 @@ impl crate::Archetype for LineStrips2D { let strips = { let array = arrays_by_name .get("rerun.components.LineStrip2D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips2D#strips")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#strips")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips2D#strips")? }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { @@ -190,8 +190,8 @@ impl crate::Archetype for LineStrips2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips2D#radii")? }) } else { @@ -202,8 +202,8 @@ impl crate::Archetype for LineStrips2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips2D#colors")? }) } else { @@ -214,8 +214,8 @@ impl crate::Archetype for LineStrips2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips2D#labels")? }) } else { @@ -228,7 +228,7 @@ impl crate::Archetype for LineStrips2D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips2D#draw_order")? }) } else { @@ -239,8 +239,8 @@ impl crate::Archetype for LineStrips2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips2D#class_ids")? }) } else { @@ -252,8 +252,8 @@ impl crate::Archetype for LineStrips2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips2D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips2D#instance_keys")? }) } else { @@ -271,31 +271,31 @@ impl crate::Archetype for LineStrips2D { } } -impl crate::AsComponents for LineStrips2D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for LineStrips2D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.strips as &dyn crate::ComponentBatch).into()), + Some((&self.strips as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.draw_order .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/line_strips3d.rs b/crates/re_types/src/archetypes/line_strips3d.rs index 070ef4d1fb2f..5b8dace59ba5 100644 --- a/crates/re_types/src/archetypes/line_strips3d.rs +++ b/crates/re_types/src/archetypes/line_strips3d.rs @@ -81,10 +81,10 @@ pub struct LineStrips3D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.LineStrip3D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Color".into(), @@ -93,7 +93,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -102,7 +102,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 7usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 7usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.LineStrip3D".into(), @@ -119,40 +119,40 @@ impl LineStrips3D { pub const NUM_COMPONENTS: usize = 7usize; } -/// Indicator component for the [`LineStrips3D`] [`crate::Archetype`] -pub type LineStrips3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`LineStrips3D`] [`::re_types_core::Archetype`] +pub type LineStrips3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for LineStrips3D { +impl ::re_types_core::Archetype for LineStrips3D { type Indicator = LineStrips3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.LineStrips3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: LineStrips3DIndicator = LineStrips3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -161,9 +161,9 @@ impl crate::Archetype for LineStrips3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -171,13 +171,13 @@ impl crate::Archetype for LineStrips3D { let strips = { let array = arrays_by_name .get("rerun.components.LineStrip3D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.LineStrips3D#strips")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#strips")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips3D#strips")? }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { @@ -185,8 +185,8 @@ impl crate::Archetype for LineStrips3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips3D#radii")? }) } else { @@ -197,8 +197,8 @@ impl crate::Archetype for LineStrips3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips3D#colors")? }) } else { @@ -209,8 +209,8 @@ impl crate::Archetype for LineStrips3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips3D#labels")? }) } else { @@ -221,8 +221,8 @@ impl crate::Archetype for LineStrips3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips3D#class_ids")? }) } else { @@ -234,8 +234,8 @@ impl crate::Archetype for LineStrips3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.LineStrips3D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.LineStrips3D#instance_keys")? }) } else { @@ -252,28 +252,28 @@ impl crate::Archetype for LineStrips3D { } } -impl crate::AsComponents for LineStrips3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for LineStrips3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.strips as &dyn crate::ComponentBatch).into()), + Some((&self.strips as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/mesh3d.rs b/crates/re_types/src/archetypes/mesh3d.rs index 99a464646b7d..25520d7eb754 100644 --- a/crates/re_types/src/archetypes/mesh3d.rs +++ b/crates/re_types/src/archetypes/mesh3d.rs @@ -80,10 +80,10 @@ pub struct Mesh3D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Position3D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Mesh3DIndicator".into(), @@ -92,7 +92,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -102,7 +102,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 8usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 8usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Position3D".into(), @@ -120,40 +120,40 @@ impl Mesh3D { pub const NUM_COMPONENTS: usize = 8usize; } -/// Indicator component for the [`Mesh3D`] [`crate::Archetype`] -pub type Mesh3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Mesh3D`] [`::re_types_core::Archetype`] +pub type Mesh3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Mesh3D { +impl ::re_types_core::Archetype for Mesh3D { type Indicator = Mesh3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Mesh3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Mesh3DIndicator = Mesh3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -162,9 +162,9 @@ impl crate::Archetype for Mesh3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -172,13 +172,13 @@ impl crate::Archetype for Mesh3D { let vertex_positions = { let array = arrays_by_name .get("rerun.components.Position3D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Mesh3D#vertex_positions")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_positions")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Mesh3D#vertex_positions")? }; let mesh_properties = @@ -189,7 +189,7 @@ impl crate::Archetype for Mesh3D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Mesh3D#mesh_properties")? }) } else { @@ -200,8 +200,8 @@ impl crate::Archetype for Mesh3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_normals")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Mesh3D#vertex_normals")? }) } else { @@ -212,8 +212,8 @@ impl crate::Archetype for Mesh3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#vertex_colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Mesh3D#vertex_colors")? }) } else { @@ -226,7 +226,7 @@ impl crate::Archetype for Mesh3D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Mesh3D#mesh_material")? }) } else { @@ -237,8 +237,8 @@ impl crate::Archetype for Mesh3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Mesh3D#class_ids")? }) } else { @@ -250,8 +250,8 @@ impl crate::Archetype for Mesh3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Mesh3D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Mesh3D#instance_keys")? }) } else { @@ -269,31 +269,31 @@ impl crate::Archetype for Mesh3D { } } -impl crate::AsComponents for Mesh3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Mesh3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.vertex_positions as &dyn crate::ComponentBatch).into()), + Some((&self.vertex_positions as &dyn ::re_types_core::ComponentBatch).into()), self.mesh_properties .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.vertex_normals .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.vertex_colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.mesh_material .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/pinhole.rs b/crates/re_types/src/archetypes/pinhole.rs index 921409776db4..ad5df17857aa 100644 --- a/crates/re_types/src/archetypes/pinhole.rs +++ b/crates/re_types/src/archetypes/pinhole.rs @@ -94,10 +94,10 @@ pub struct Pinhole { pub camera_xyz: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.PinholeProjection".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.PinholeIndicator".into(), @@ -105,7 +105,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.InstanceKey".into(), @@ -113,7 +113,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 5usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.PinholeProjection".into(), @@ -128,40 +128,40 @@ impl Pinhole { pub const NUM_COMPONENTS: usize = 5usize; } -/// Indicator component for the [`Pinhole`] [`crate::Archetype`] -pub type PinholeIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Pinhole`] [`::re_types_core::Archetype`] +pub type PinholeIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Pinhole { +impl ::re_types_core::Archetype for Pinhole { type Indicator = PinholeIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Pinhole".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: PinholeIndicator = PinholeIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -170,9 +170,9 @@ impl crate::Archetype for Pinhole { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -180,14 +180,14 @@ impl crate::Archetype for Pinhole { let image_from_camera = { let array = arrays_by_name .get("rerun.components.PinholeProjection") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#image_from_camera")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Pinhole#image_from_camera")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#image_from_camera")? }; let resolution = if let Some(array) = arrays_by_name.get("rerun.components.Resolution") { @@ -197,7 +197,7 @@ impl crate::Archetype for Pinhole { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#resolution")? }) } else { @@ -211,7 +211,7 @@ impl crate::Archetype for Pinhole { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Pinhole#camera_xyz")? }) } else { @@ -225,19 +225,19 @@ impl crate::Archetype for Pinhole { } } -impl crate::AsComponents for Pinhole { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Pinhole { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.image_from_camera as &dyn crate::ComponentBatch).into()), + Some((&self.image_from_camera as &dyn ::re_types_core::ComponentBatch).into()), self.resolution .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.camera_xyz .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/points2d.rs b/crates/re_types/src/archetypes/points2d.rs index 79a3660421f5..f69f316422aa 100644 --- a/crates/re_types/src/archetypes/points2d.rs +++ b/crates/re_types/src/archetypes/points2d.rs @@ -91,10 +91,10 @@ pub struct Points2D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Position2D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Color".into(), @@ -103,7 +103,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 5usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -114,7 +114,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 5usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 9usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 9usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Position2D".into(), @@ -133,40 +133,40 @@ impl Points2D { pub const NUM_COMPONENTS: usize = 9usize; } -/// Indicator component for the [`Points2D`] [`crate::Archetype`] -pub type Points2DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Points2D`] [`::re_types_core::Archetype`] +pub type Points2DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Points2D { +impl ::re_types_core::Archetype for Points2D { type Indicator = Points2DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Points2D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Points2DIndicator = Points2DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -175,9 +175,9 @@ impl crate::Archetype for Points2D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -185,13 +185,13 @@ impl crate::Archetype for Points2D { let positions = { let array = arrays_by_name .get("rerun.components.Position2D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Points2D#positions")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#positions")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#positions")? }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { @@ -199,8 +199,8 @@ impl crate::Archetype for Points2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#radii")? }) } else { @@ -211,8 +211,8 @@ impl crate::Archetype for Points2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#colors")? }) } else { @@ -223,8 +223,8 @@ impl crate::Archetype for Points2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#labels")? }) } else { @@ -237,7 +237,7 @@ impl crate::Archetype for Points2D { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Points2D#draw_order")? }) } else { @@ -248,8 +248,8 @@ impl crate::Archetype for Points2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#class_ids")? }) } else { @@ -260,8 +260,8 @@ impl crate::Archetype for Points2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#keypoint_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#keypoint_ids")? }) } else { @@ -273,8 +273,8 @@ impl crate::Archetype for Points2D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points2D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points2D#instance_keys")? }) } else { @@ -293,34 +293,34 @@ impl crate::Archetype for Points2D { } } -impl crate::AsComponents for Points2D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Points2D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.positions as &dyn crate::ComponentBatch).into()), + Some((&self.positions as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.draw_order .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.keypoint_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/points3d.rs b/crates/re_types/src/archetypes/points3d.rs index 0cbcfab9adfc..d1e2bc1b0dec 100644 --- a/crates/re_types/src/archetypes/points3d.rs +++ b/crates/re_types/src/archetypes/points3d.rs @@ -86,10 +86,10 @@ pub struct Points3D { pub instance_keys: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Position3D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Color".into(), @@ -98,7 +98,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ClassId".into(), @@ -108,7 +108,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 8usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 8usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Position3D".into(), @@ -126,40 +126,40 @@ impl Points3D { pub const NUM_COMPONENTS: usize = 8usize; } -/// Indicator component for the [`Points3D`] [`crate::Archetype`] -pub type Points3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Points3D`] [`::re_types_core::Archetype`] +pub type Points3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Points3D { +impl ::re_types_core::Archetype for Points3D { type Indicator = Points3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Points3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Points3DIndicator = Points3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -168,9 +168,9 @@ impl crate::Archetype for Points3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -178,13 +178,13 @@ impl crate::Archetype for Points3D { let positions = { let array = arrays_by_name .get("rerun.components.Position3D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Points3D#positions")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#positions")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#positions")? }; let radii = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { @@ -192,8 +192,8 @@ impl crate::Archetype for Points3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#radii")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#radii")? }) } else { @@ -204,8 +204,8 @@ impl crate::Archetype for Points3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#colors")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#colors")? }) } else { @@ -216,8 +216,8 @@ impl crate::Archetype for Points3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#labels")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#labels")? }) } else { @@ -228,8 +228,8 @@ impl crate::Archetype for Points3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#class_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#class_ids")? }) } else { @@ -240,8 +240,8 @@ impl crate::Archetype for Points3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#keypoint_ids")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#keypoint_ids")? }) } else { @@ -253,8 +253,8 @@ impl crate::Archetype for Points3D { ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Points3D#instance_keys")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.archetypes.Points3D#instance_keys")? }) } else { @@ -272,31 +272,31 @@ impl crate::Archetype for Points3D { } } -impl crate::AsComponents for Points3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Points3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.positions as &dyn crate::ComponentBatch).into()), + Some((&self.positions as &dyn ::re_types_core::ComponentBatch).into()), self.radii .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.colors .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.labels .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.class_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.keypoint_ids .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.instance_keys .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/segmentation_image.rs b/crates/re_types/src/archetypes/segmentation_image.rs index fa48de27fb4b..efad927adaa8 100644 --- a/crates/re_types/src/archetypes/segmentation_image.rs +++ b/crates/re_types/src/archetypes/segmentation_image.rs @@ -76,13 +76,13 @@ pub struct SegmentationImage { pub draw_order: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TensorData".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.SegmentationImageIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.DrawOrder".into(), @@ -90,7 +90,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.TensorData".into(), @@ -104,40 +104,40 @@ impl SegmentationImage { pub const NUM_COMPONENTS: usize = 4usize; } -/// Indicator component for the [`SegmentationImage`] [`crate::Archetype`] -pub type SegmentationImageIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`SegmentationImage`] [`::re_types_core::Archetype`] +pub type SegmentationImageIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for SegmentationImage { +impl ::re_types_core::Archetype for SegmentationImage { type Indicator = SegmentationImageIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.SegmentationImage".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: SegmentationImageIndicator = SegmentationImageIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -146,9 +146,9 @@ impl crate::Archetype for SegmentationImage { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -156,14 +156,14 @@ impl crate::Archetype for SegmentationImage { let data = { let array = arrays_by_name .get("rerun.components.TensorData") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#data")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.SegmentationImage#data")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#data")? }; let draw_order = if let Some(array) = arrays_by_name.get("rerun.components.DrawOrder") { @@ -173,7 +173,7 @@ impl crate::Archetype for SegmentationImage { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.SegmentationImage#draw_order")? }) } else { @@ -183,16 +183,16 @@ impl crate::Archetype for SegmentationImage { } } -impl crate::AsComponents for SegmentationImage { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for SegmentationImage { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.data as &dyn crate::ComponentBatch).into()), + Some((&self.data as &dyn ::re_types_core::ComponentBatch).into()), self.draw_order .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/segmentation_image_ext.rs b/crates/re_types/src/archetypes/segmentation_image_ext.rs index 5daeb64f512d..81108e6bf683 100644 --- a/crates/re_types/src/archetypes/segmentation_image_ext.rs +++ b/crates/re_types/src/archetypes/segmentation_image_ext.rs @@ -37,7 +37,7 @@ impl SegmentationImage { } } -fn assign_if_none(name: &mut Option, new_name: &str) { +fn assign_if_none(name: &mut Option<::re_types_core::ArrowString>, new_name: &str) { if name.is_none() { *name = Some(new_name.into()); } diff --git a/crates/re_types/src/archetypes/tensor.rs b/crates/re_types/src/archetypes/tensor.rs index f82302c859ae..888ed8c77a29 100644 --- a/crates/re_types/src/archetypes/tensor.rs +++ b/crates/re_types/src/archetypes/tensor.rs @@ -53,16 +53,16 @@ pub struct Tensor { pub data: crate::components::TensorData, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TensorData".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TensorIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.TensorData".into(), @@ -75,40 +75,40 @@ impl Tensor { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`Tensor`] [`crate::Archetype`] -pub type TensorIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Tensor`] [`::re_types_core::Archetype`] +pub type TensorIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Tensor { +impl ::re_types_core::Archetype for Tensor { type Indicator = TensorIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Tensor".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: TensorIndicator = TensorIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -117,9 +117,9 @@ impl crate::Archetype for Tensor { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -127,27 +127,27 @@ impl crate::Archetype for Tensor { let data = { let array = arrays_by_name .get("rerun.components.TensorData") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Tensor#data")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Tensor#data")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Tensor#data")? }; Ok(Self { data }) } } -impl crate::AsComponents for Tensor { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Tensor { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.data as &dyn crate::ComponentBatch).into()), + Some((&self.data as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/tensor_ext.rs b/crates/re_types/src/archetypes/tensor_ext.rs index 1f59688d1ae2..885182ae278b 100644 --- a/crates/re_types/src/archetypes/tensor_ext.rs +++ b/crates/re_types/src/archetypes/tensor_ext.rs @@ -1,7 +1,6 @@ -use crate::{ - datatypes::{TensorData, TensorDimension}, - ArrowString, -}; +use crate::datatypes::{TensorData, TensorDimension}; + +use re_types_core::ArrowString; use super::Tensor; diff --git a/crates/re_types/src/archetypes/text_document.rs b/crates/re_types/src/archetypes/text_document.rs index 16b076b7916a..10986f31d820 100644 --- a/crates/re_types/src/archetypes/text_document.rs +++ b/crates/re_types/src/archetypes/text_document.rs @@ -32,13 +32,13 @@ pub struct TextDocument { pub media_type: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Text".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.TextDocumentIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.InstanceKey".into(), @@ -46,7 +46,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Text".into(), @@ -60,40 +60,40 @@ impl TextDocument { pub const NUM_COMPONENTS: usize = 4usize; } -/// Indicator component for the [`TextDocument`] [`crate::Archetype`] -pub type TextDocumentIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`TextDocument`] [`::re_types_core::Archetype`] +pub type TextDocumentIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for TextDocument { +impl ::re_types_core::Archetype for TextDocument { type Indicator = TextDocumentIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.TextDocument".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: TextDocumentIndicator = TextDocumentIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -102,9 +102,9 @@ impl crate::Archetype for TextDocument { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -112,14 +112,14 @@ impl crate::Archetype for TextDocument { let text = { let array = arrays_by_name .get("rerun.components.Text") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextDocument#text")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextDocument#text")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextDocument#text")? }; let media_type = if let Some(array) = arrays_by_name.get("rerun.components.MediaType") { @@ -129,7 +129,7 @@ impl crate::Archetype for TextDocument { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextDocument#media_type")? }) } else { @@ -139,16 +139,16 @@ impl crate::Archetype for TextDocument { } } -impl crate::AsComponents for TextDocument { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for TextDocument { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.text as &dyn crate::ComponentBatch).into()), + Some((&self.text as &dyn ::re_types_core::ComponentBatch).into()), self.media_type .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/text_log.rs b/crates/re_types/src/archetypes/text_log.rs index bd822228b8b1..49ea85001822 100644 --- a/crates/re_types/src/archetypes/text_log.rs +++ b/crates/re_types/src/archetypes/text_log.rs @@ -70,10 +70,10 @@ pub struct TextLog { pub color: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Text".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 2usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.TextLogIndicator".into(), @@ -81,10 +81,10 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 2usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 4usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 4usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Text".into(), @@ -98,40 +98,40 @@ impl TextLog { pub const NUM_COMPONENTS: usize = 4usize; } -/// Indicator component for the [`TextLog`] [`crate::Archetype`] -pub type TextLogIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`TextLog`] [`::re_types_core::Archetype`] +pub type TextLogIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for TextLog { +impl ::re_types_core::Archetype for TextLog { type Indicator = TextLogIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.TextLog".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: TextLogIndicator = TextLogIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -140,9 +140,9 @@ impl crate::Archetype for TextLog { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -150,14 +150,14 @@ impl crate::Archetype for TextLog { let text = { let array = arrays_by_name .get("rerun.components.Text") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#text")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TextLog#text")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#text")? }; let level = if let Some(array) = arrays_by_name.get("rerun.components.TextLogLevel") { @@ -167,7 +167,7 @@ impl crate::Archetype for TextLog { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#level")? }) } else { @@ -180,7 +180,7 @@ impl crate::Archetype for TextLog { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TextLog#color")? }) } else { @@ -190,19 +190,19 @@ impl crate::Archetype for TextLog { } } -impl crate::AsComponents for TextLog { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for TextLog { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.text as &dyn crate::ComponentBatch).into()), + Some((&self.text as &dyn ::re_types_core::ComponentBatch).into()), self.level .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.color .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/time_series_scalar.rs b/crates/re_types/src/archetypes/time_series_scalar.rs index e7b388c2fc63..5a273dee8397 100644 --- a/crates/re_types/src/archetypes/time_series_scalar.rs +++ b/crates/re_types/src/archetypes/time_series_scalar.rs @@ -97,10 +97,10 @@ pub struct TimeSeriesScalar { pub scattered: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Scalar".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Color".into(), @@ -109,7 +109,7 @@ static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usi ] }); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.InstanceKey".into(), @@ -118,7 +118,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize] ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 7usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 7usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Scalar".into(), @@ -135,40 +135,40 @@ impl TimeSeriesScalar { pub const NUM_COMPONENTS: usize = 7usize; } -/// Indicator component for the [`TimeSeriesScalar`] [`crate::Archetype`] -pub type TimeSeriesScalarIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`TimeSeriesScalar`] [`::re_types_core::Archetype`] +pub type TimeSeriesScalarIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for TimeSeriesScalar { +impl ::re_types_core::Archetype for TimeSeriesScalar { type Indicator = TimeSeriesScalarIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.TimeSeriesScalar".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: TimeSeriesScalarIndicator = TimeSeriesScalarIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -177,9 +177,9 @@ impl crate::Archetype for TimeSeriesScalar { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -187,14 +187,14 @@ impl crate::Archetype for TimeSeriesScalar { let scalar = { let array = arrays_by_name .get("rerun.components.Scalar") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TimeSeriesScalar#scalar")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.TimeSeriesScalar#scalar")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TimeSeriesScalar#scalar")? }; let radius = if let Some(array) = arrays_by_name.get("rerun.components.Radius") { @@ -204,7 +204,7 @@ impl crate::Archetype for TimeSeriesScalar { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TimeSeriesScalar#radius")? }) } else { @@ -217,7 +217,7 @@ impl crate::Archetype for TimeSeriesScalar { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TimeSeriesScalar#color")? }) } else { @@ -230,7 +230,7 @@ impl crate::Archetype for TimeSeriesScalar { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TimeSeriesScalar#label")? }) } else { @@ -244,7 +244,7 @@ impl crate::Archetype for TimeSeriesScalar { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.TimeSeriesScalar#scattered")? }) } else { @@ -260,25 +260,25 @@ impl crate::Archetype for TimeSeriesScalar { } } -impl crate::AsComponents for TimeSeriesScalar { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for TimeSeriesScalar { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.scalar as &dyn crate::ComponentBatch).into()), + Some((&self.scalar as &dyn ::re_types_core::ComponentBatch).into()), self.radius .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.color .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.label .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.scattered .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/transform3d.rs b/crates/re_types/src/archetypes/transform3d.rs index b806b36ee607..89bd517b5da8 100644 --- a/crates/re_types/src/archetypes/transform3d.rs +++ b/crates/re_types/src/archetypes/transform3d.rs @@ -68,16 +68,16 @@ pub struct Transform3D { pub transform: crate::components::Transform3D, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Transform3D".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.Transform3DIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.Transform3D".into(), @@ -90,40 +90,40 @@ impl Transform3D { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`Transform3D`] [`crate::Archetype`] -pub type Transform3DIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`Transform3D`] [`::re_types_core::Archetype`] +pub type Transform3DIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for Transform3D { +impl ::re_types_core::Archetype for Transform3D { type Indicator = Transform3DIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.Transform3D".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: Transform3DIndicator = Transform3DIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -132,9 +132,9 @@ impl crate::Archetype for Transform3D { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -142,27 +142,27 @@ impl crate::Archetype for Transform3D { let transform = { let array = arrays_by_name .get("rerun.components.Transform3D") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Transform3D#transform")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.Transform3D#transform")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.Transform3D#transform")? }; Ok(Self { transform }) } } -impl crate::AsComponents for Transform3D { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for Transform3D { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.transform as &dyn crate::ComponentBatch).into()), + Some((&self.transform as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/archetypes/view_coordinates.rs b/crates/re_types/src/archetypes/view_coordinates.rs index 861ddb32848a..c707ae75db8f 100644 --- a/crates/re_types/src/archetypes/view_coordinates.rs +++ b/crates/re_types/src/archetypes/view_coordinates.rs @@ -61,16 +61,16 @@ pub struct ViewCoordinates { pub xyz: crate::components::ViewCoordinates, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.ViewCoordinates".into()]); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.ViewCoordinatesIndicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 3usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 3usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.ViewCoordinates".into(), @@ -83,40 +83,40 @@ impl ViewCoordinates { pub const NUM_COMPONENTS: usize = 3usize; } -/// Indicator component for the [`ViewCoordinates`] [`crate::Archetype`] -pub type ViewCoordinatesIndicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`ViewCoordinates`] [`::re_types_core::Archetype`] +pub type ViewCoordinatesIndicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for ViewCoordinates { +impl ::re_types_core::Archetype for ViewCoordinates { type Indicator = ViewCoordinatesIndicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.archetypes.ViewCoordinates".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: ViewCoordinatesIndicator = ViewCoordinatesIndicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -125,9 +125,9 @@ impl crate::Archetype for ViewCoordinates { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -135,27 +135,27 @@ impl crate::Archetype for ViewCoordinates { let xyz = { let array = arrays_by_name .get("rerun.components.ViewCoordinates") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.ViewCoordinates#xyz")?; ::from_arrow_opt(&**array) .with_context("rerun.archetypes.ViewCoordinates#xyz")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.archetypes.ViewCoordinates#xyz")? }; Ok(Self { xyz }) } } -impl crate::AsComponents for ViewCoordinates { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for ViewCoordinates { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.xyz as &dyn crate::ComponentBatch).into()), + Some((&self.xyz as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/blueprint/auto_space_views.rs b/crates/re_types/src/blueprint/auto_space_views.rs index 58d70dde0d81..d8827ef7461e 100644 --- a/crates/re_types/src/blueprint/auto_space_views.rs +++ b/crates/re_types/src/blueprint/auto_space_views.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a AutoSpaceViews> for ::std::borrow::Cow<'a, AutoSpaceViews> { } } -impl crate::Loggable for AutoSpaceViews { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AutoSpaceViews { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -67,13 +67,13 @@ impl crate::Loggable for AutoSpaceViews { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -102,27 +102,27 @@ impl crate::Loggable for AutoSpaceViews { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) }) .with_context("rerun.blueprint.AutoSpaceViews#enabled")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.blueprint.AutoSpaceViews#enabled") .with_context("rerun.blueprint.AutoSpaceViews")?) } diff --git a/crates/re_types/src/blueprint/panel_view.rs b/crates/re_types/src/blueprint/panel_view.rs index 97394f78e0b6..9bbde6174018 100644 --- a/crates/re_types/src/blueprint/panel_view.rs +++ b/crates/re_types/src/blueprint/panel_view.rs @@ -50,8 +50,8 @@ impl<'a> From<&'a PanelView> for ::std::borrow::Cow<'a, PanelView> { } } -impl crate::Loggable for PanelView { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for PanelView { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for PanelView { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -128,19 +128,19 @@ impl crate::Loggable for PanelView { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![Field { name: "is_expanded".to_owned(), data_type: DataType::Boolean, @@ -163,7 +163,7 @@ impl crate::Loggable for PanelView { .collect(); let is_expanded = { if !arrays_by_name.contains_key("is_expanded") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "is_expanded", )) @@ -174,7 +174,7 @@ impl crate::Loggable for PanelView { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) @@ -190,13 +190,13 @@ impl crate::Loggable for PanelView { opt.map(|(is_expanded)| { Ok(Self { is_expanded: is_expanded - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.blueprint.PanelView#is_expanded")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.blueprint.PanelView")? } }) diff --git a/crates/re_types/src/components/annotation_context.rs b/crates/re_types/src/components/annotation_context.rs index 04fc286bf7bf..d534e21a5869 100644 --- a/crates/re_types/src/components/annotation_context.rs +++ b/crates/re_types/src/components/annotation_context.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a AnnotationContext> for ::std::borrow::Cow<'a, AnnotationContex } } -impl crate::Loggable for AnnotationContext { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AnnotationContext { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -72,13 +72,13 @@ impl crate::Loggable for AnnotationContext { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -129,19 +129,19 @@ impl crate::Loggable for AnnotationContext { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype( @@ -173,7 +173,7 @@ impl crate::Loggable for AnnotationContext { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -191,13 +191,13 @@ impl crate::Loggable for AnnotationContext { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.AnnotationContext#class_map") .with_context("rerun.components.AnnotationContext")?) } diff --git a/crates/re_types/src/components/blob.rs b/crates/re_types/src/components/blob.rs index 79aed4354d84..af0cae7b8943 100644 --- a/crates/re_types/src/components/blob.rs +++ b/crates/re_types/src/components/blob.rs @@ -17,16 +17,16 @@ /// **Component**: A binary blob of data. #[derive(Clone, Debug, PartialEq, Eq)] #[repr(transparent)] -pub struct Blob(pub crate::ArrowBuffer); +pub struct Blob(pub ::re_types_core::ArrowBuffer); -impl From> for Blob { +impl From<::re_types_core::ArrowBuffer> for Blob { #[inline] - fn from(data: crate::ArrowBuffer) -> Self { + fn from(data: ::re_types_core::ArrowBuffer) -> Self { Self(data) } } -impl From for crate::ArrowBuffer { +impl From for ::re_types_core::ArrowBuffer { #[inline] fn from(value: Blob) -> Self { value.0 @@ -47,8 +47,8 @@ impl<'a> From<&'a Blob> for ::std::borrow::Cow<'a, Blob> { } } -impl crate::Loggable for Blob { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Blob { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -70,13 +70,13 @@ impl crate::Loggable for Blob { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -126,19 +126,19 @@ impl crate::Loggable for Blob { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, @@ -158,7 +158,7 @@ impl crate::Loggable for Blob { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt8, arrow_data_inner.data_type().clone(), ) @@ -176,7 +176,7 @@ impl crate::Loggable for Blob { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -188,18 +188,18 @@ impl crate::Loggable for Blob { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Blob#data") .with_context("rerun.components.Blob")?) } diff --git a/crates/re_types/src/components/class_id.rs b/crates/re_types/src/components/class_id.rs index 469eedff3bc2..4389fd93048e 100644 --- a/crates/re_types/src/components/class_id.rs +++ b/crates/re_types/src/components/class_id.rs @@ -60,8 +60,8 @@ impl<'a> From<&'a ClassId> for ::std::borrow::Cow<'a, ClassId> { } } -impl crate::Loggable for ClassId { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for ClassId { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -78,13 +78,13 @@ impl crate::Loggable for ClassId { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -123,18 +123,18 @@ impl crate::Loggable for ClassId { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -143,9 +143,9 @@ impl crate::Loggable for ClassId { .into_iter() .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::ClassId(v))) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.ClassId#id") .with_context("rerun.components.ClassId")?) } @@ -154,16 +154,16 @@ impl crate::Loggable for ClassId { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -171,7 +171,7 @@ impl crate::Loggable for ClassId { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/clear_is_recursive.rs b/crates/re_types/src/components/clear_is_recursive.rs index 68abd1430f27..2c4d5f2d6cbc 100644 --- a/crates/re_types/src/components/clear_is_recursive.rs +++ b/crates/re_types/src/components/clear_is_recursive.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a ClearIsRecursive> for ::std::borrow::Cow<'a, ClearIsRecursive> } } -impl crate::Loggable for ClearIsRecursive { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for ClearIsRecursive { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -67,13 +67,13 @@ impl crate::Loggable for ClearIsRecursive { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -102,27 +102,27 @@ impl crate::Loggable for ClearIsRecursive { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) }) .with_context("rerun.components.ClearIsRecursive#recursive")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.ClearIsRecursive#recursive") .with_context("rerun.components.ClearIsRecursive")?) } diff --git a/crates/re_types/src/components/color.rs b/crates/re_types/src/components/color.rs index 5e8bdddd9b4d..8b6b32076edb 100644 --- a/crates/re_types/src/components/color.rs +++ b/crates/re_types/src/components/color.rs @@ -58,8 +58,8 @@ impl<'a> From<&'a Color> for ::std::borrow::Cow<'a, Color> { } } -impl crate::Loggable for Color { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Color { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -76,13 +76,13 @@ impl crate::Loggable for Color { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -121,18 +121,18 @@ impl crate::Loggable for Color { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) @@ -141,9 +141,9 @@ impl crate::Loggable for Color { .into_iter() .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Rgba32(v))) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Color#rgba") .with_context("rerun.components.Color")?) } @@ -152,16 +152,16 @@ impl crate::Loggable for Color { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -169,7 +169,7 @@ impl crate::Loggable for Color { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/depth_meter.rs b/crates/re_types/src/components/depth_meter.rs index d3fb6bca1409..4a18925e772d 100644 --- a/crates/re_types/src/components/depth_meter.rs +++ b/crates/re_types/src/components/depth_meter.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a DepthMeter> for ::std::borrow::Cow<'a, DepthMeter> { } } -impl crate::Loggable for DepthMeter { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for DepthMeter { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -65,13 +65,13 @@ impl crate::Loggable for DepthMeter { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -100,18 +100,18 @@ impl crate::Loggable for DepthMeter { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -119,9 +119,9 @@ impl crate::Loggable for DepthMeter { .with_context("rerun.components.DepthMeter#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.DepthMeter#value") .with_context("rerun.components.DepthMeter")?) } @@ -130,16 +130,16 @@ impl crate::Loggable for DepthMeter { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -147,7 +147,7 @@ impl crate::Loggable for DepthMeter { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/disconnected_space.rs b/crates/re_types/src/components/disconnected_space.rs index e0c8cdd81f98..2ddf4c170499 100644 --- a/crates/re_types/src/components/disconnected_space.rs +++ b/crates/re_types/src/components/disconnected_space.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a DisconnectedSpace> for ::std::borrow::Cow<'a, DisconnectedSpac } } -impl crate::Loggable for DisconnectedSpace { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for DisconnectedSpace { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -71,13 +71,13 @@ impl crate::Loggable for DisconnectedSpace { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -106,27 +106,27 @@ impl crate::Loggable for DisconnectedSpace { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) }) .with_context("rerun.components.DisconnectedSpace#is_disconnected")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.DisconnectedSpace#is_disconnected") .with_context("rerun.components.DisconnectedSpace")?) } diff --git a/crates/re_types/src/components/draw_order.rs b/crates/re_types/src/components/draw_order.rs index 5f8e8ae54b55..d4eec8821367 100644 --- a/crates/re_types/src/components/draw_order.rs +++ b/crates/re_types/src/components/draw_order.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a DrawOrder> for ::std::borrow::Cow<'a, DrawOrder> { } } -impl crate::Loggable for DrawOrder { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for DrawOrder { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -71,13 +71,13 @@ impl crate::Loggable for DrawOrder { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -106,18 +106,18 @@ impl crate::Loggable for DrawOrder { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -125,9 +125,9 @@ impl crate::Loggable for DrawOrder { .with_context("rerun.components.DrawOrder#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.DrawOrder#value") .with_context("rerun.components.DrawOrder")?) } @@ -136,16 +136,16 @@ impl crate::Loggable for DrawOrder { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -153,7 +153,7 @@ impl crate::Loggable for DrawOrder { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/half_sizes2d.rs b/crates/re_types/src/components/half_sizes2d.rs index 8acc8351d2dc..ea92ee241832 100644 --- a/crates/re_types/src/components/half_sizes2d.rs +++ b/crates/re_types/src/components/half_sizes2d.rs @@ -57,8 +57,8 @@ impl<'a> From<&'a HalfSizes2D> for ::std::borrow::Cow<'a, HalfSizes2D> { } } -impl crate::Loggable for HalfSizes2D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for HalfSizes2D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -83,13 +83,13 @@ impl crate::Loggable for HalfSizes2D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -151,19 +151,19 @@ impl crate::Loggable for HalfSizes2D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -189,7 +189,7 @@ impl crate::Loggable for HalfSizes2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -207,7 +207,7 @@ impl crate::Loggable for HalfSizes2D { elem.map(|(start, end)| { debug_assert!(end - start == 2usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -225,13 +225,13 @@ impl crate::Loggable for HalfSizes2D { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Vec2D(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.HalfSizes2D#xy") .with_context("rerun.components.HalfSizes2D")?) } @@ -240,16 +240,16 @@ impl crate::Loggable for HalfSizes2D { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -258,7 +258,7 @@ impl crate::Loggable for HalfSizes2D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -278,7 +278,7 @@ impl crate::Loggable for HalfSizes2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/half_sizes3d.rs b/crates/re_types/src/components/half_sizes3d.rs index 09c2487a148c..b14e690c51ee 100644 --- a/crates/re_types/src/components/half_sizes3d.rs +++ b/crates/re_types/src/components/half_sizes3d.rs @@ -57,8 +57,8 @@ impl<'a> From<&'a HalfSizes3D> for ::std::borrow::Cow<'a, HalfSizes3D> { } } -impl crate::Loggable for HalfSizes3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for HalfSizes3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -83,13 +83,13 @@ impl crate::Loggable for HalfSizes3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -151,19 +151,19 @@ impl crate::Loggable for HalfSizes3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -189,7 +189,7 @@ impl crate::Loggable for HalfSizes3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -207,7 +207,7 @@ impl crate::Loggable for HalfSizes3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -225,13 +225,13 @@ impl crate::Loggable for HalfSizes3D { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Vec3D(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.HalfSizes3D#xyz") .with_context("rerun.components.HalfSizes3D")?) } @@ -240,16 +240,16 @@ impl crate::Loggable for HalfSizes3D { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -258,7 +258,7 @@ impl crate::Loggable for HalfSizes3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -278,7 +278,7 @@ impl crate::Loggable for HalfSizes3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/instance_key.rs b/crates/re_types/src/components/instance_key.rs index d2d750fd49f4..ef5d7881df14 100644 --- a/crates/re_types/src/components/instance_key.rs +++ b/crates/re_types/src/components/instance_key.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a InstanceKey> for ::std::borrow::Cow<'a, InstanceKey> { } } -impl crate::Loggable for InstanceKey { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for InstanceKey { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -65,13 +65,13 @@ impl crate::Loggable for InstanceKey { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -100,18 +100,18 @@ impl crate::Loggable for InstanceKey { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt64, arrow_data.data_type().clone(), ) @@ -119,9 +119,9 @@ impl crate::Loggable for InstanceKey { .with_context("rerun.components.InstanceKey#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.InstanceKey#value") .with_context("rerun.components.InstanceKey")?) } @@ -130,16 +130,16 @@ impl crate::Loggable for InstanceKey { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -147,7 +147,7 @@ impl crate::Loggable for InstanceKey { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt64, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/keypoint_id.rs b/crates/re_types/src/components/keypoint_id.rs index fd506eea4d5b..0ece63eea00b 100644 --- a/crates/re_types/src/components/keypoint_id.rs +++ b/crates/re_types/src/components/keypoint_id.rs @@ -62,8 +62,8 @@ impl<'a> From<&'a KeypointId> for ::std::borrow::Cow<'a, KeypointId> { } } -impl crate::Loggable for KeypointId { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for KeypointId { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -80,13 +80,13 @@ impl crate::Loggable for KeypointId { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -125,18 +125,18 @@ impl crate::Loggable for KeypointId { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -145,9 +145,9 @@ impl crate::Loggable for KeypointId { .into_iter() .map(|opt| opt.copied()) .map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::KeypointId(v))) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.KeypointId#id") .with_context("rerun.components.KeypointId")?) } @@ -156,16 +156,16 @@ impl crate::Loggable for KeypointId { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -173,7 +173,7 @@ impl crate::Loggable for KeypointId { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/line_strip2d.rs b/crates/re_types/src/components/line_strip2d.rs index 8569ff1ffa7e..212d142cb25f 100644 --- a/crates/re_types/src/components/line_strip2d.rs +++ b/crates/re_types/src/components/line_strip2d.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a LineStrip2D> for ::std::borrow::Cow<'a, LineStrip2D> { } } -impl crate::Loggable for LineStrip2D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for LineStrip2D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -72,13 +72,13 @@ impl crate::Loggable for LineStrip2D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -172,19 +172,19 @@ impl crate::Loggable for LineStrip2D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -205,7 +205,7 @@ impl crate::Loggable for LineStrip2D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -231,7 +231,7 @@ impl crate::Loggable for LineStrip2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner_inner.data_type().clone(), ) @@ -249,10 +249,12 @@ impl crate::Loggable for LineStrip2D { elem.map(|(start, end)| { debug_assert!(end - start == 2usize); if end as usize > arrow_data_inner_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -271,7 +273,7 @@ impl crate::Loggable for LineStrip2D { res_or_opt.map(|v| crate::datatypes::Vec2D(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -287,7 +289,7 @@ impl crate::Loggable for LineStrip2D { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -305,13 +307,13 @@ impl crate::Loggable for LineStrip2D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.LineStrip2D#points") .with_context("rerun.components.LineStrip2D")?) } diff --git a/crates/re_types/src/components/line_strip3d.rs b/crates/re_types/src/components/line_strip3d.rs index 44eae2820698..d08629f4b4c0 100644 --- a/crates/re_types/src/components/line_strip3d.rs +++ b/crates/re_types/src/components/line_strip3d.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a LineStrip3D> for ::std::borrow::Cow<'a, LineStrip3D> { } } -impl crate::Loggable for LineStrip3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for LineStrip3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -72,13 +72,13 @@ impl crate::Loggable for LineStrip3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -172,19 +172,19 @@ impl crate::Loggable for LineStrip3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -205,7 +205,7 @@ impl crate::Loggable for LineStrip3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -231,7 +231,7 @@ impl crate::Loggable for LineStrip3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner_inner.data_type().clone(), ) @@ -249,10 +249,12 @@ impl crate::Loggable for LineStrip3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -271,7 +273,7 @@ impl crate::Loggable for LineStrip3D { res_or_opt.map(|v| crate::datatypes::Vec3D(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -287,7 +289,7 @@ impl crate::Loggable for LineStrip3D { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -305,13 +307,13 @@ impl crate::Loggable for LineStrip3D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.LineStrip3D#points") .with_context("rerun.components.LineStrip3D")?) } diff --git a/crates/re_types/src/components/material.rs b/crates/re_types/src/components/material.rs index 1eddedb9ac01..ddf2754a1107 100644 --- a/crates/re_types/src/components/material.rs +++ b/crates/re_types/src/components/material.rs @@ -54,8 +54,8 @@ impl<'a> From<&'a Material> for ::std::borrow::Cow<'a, Material> { } } -impl crate::Loggable for Material { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Material { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -77,13 +77,13 @@ impl crate::Loggable for Material { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -110,19 +110,19 @@ impl crate::Loggable for Material { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(crate::datatypes::Material::from_arrow_opt(arrow_data) .with_context("rerun.components.Material#material")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Material#material") .with_context("rerun.components.Material")?) } diff --git a/crates/re_types/src/components/media_type.rs b/crates/re_types/src/components/media_type.rs index f9b0e0f5c60f..7b51ceb58280 100644 --- a/crates/re_types/src/components/media_type.rs +++ b/crates/re_types/src/components/media_type.rs @@ -58,8 +58,8 @@ impl<'a> From<&'a MediaType> for ::std::borrow::Cow<'a, MediaType> { } } -impl crate::Loggable for MediaType { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for MediaType { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -76,13 +76,13 @@ impl crate::Loggable for MediaType { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -137,19 +137,19 @@ impl crate::Loggable for MediaType { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -166,7 +166,7 @@ impl crate::Loggable for MediaType { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -180,16 +180,16 @@ impl crate::Loggable for MediaType { }) .map(|res_or_opt| { res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| crate::datatypes::Utf8(crate::ArrowString(v))) + res_or_opt.map(|v| crate::datatypes::Utf8(::re_types_core::ArrowString(v))) }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.MediaType#value")? .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.MediaType#value") .with_context("rerun.components.MediaType")?) } diff --git a/crates/re_types/src/components/mesh_properties.rs b/crates/re_types/src/components/mesh_properties.rs index 4622f3352918..4547ccca4eaa 100644 --- a/crates/re_types/src/components/mesh_properties.rs +++ b/crates/re_types/src/components/mesh_properties.rs @@ -54,8 +54,8 @@ impl<'a> From<&'a MeshProperties> for ::std::borrow::Cow<'a, MeshProperties> { } } -impl crate::Loggable for MeshProperties { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for MeshProperties { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -82,13 +82,13 @@ impl crate::Loggable for MeshProperties { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -115,19 +115,19 @@ impl crate::Loggable for MeshProperties { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(crate::datatypes::MeshProperties::from_arrow_opt(arrow_data) .with_context("rerun.components.MeshProperties#props")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.MeshProperties#props") .with_context("rerun.components.MeshProperties")?) } diff --git a/crates/re_types/src/components/out_of_tree_transform3d.rs b/crates/re_types/src/components/out_of_tree_transform3d.rs index ab1551123253..e2d889b00f39 100644 --- a/crates/re_types/src/components/out_of_tree_transform3d.rs +++ b/crates/re_types/src/components/out_of_tree_transform3d.rs @@ -59,8 +59,8 @@ impl<'a> From<&'a OutOfTreeTransform3D> for ::std::borrow::Cow<'a, OutOfTreeTran } } -impl crate::Loggable for OutOfTreeTransform3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for OutOfTreeTransform3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -100,13 +100,13 @@ impl crate::Loggable for OutOfTreeTransform3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -133,19 +133,19 @@ impl crate::Loggable for OutOfTreeTransform3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(crate::datatypes::Transform3D::from_arrow_opt(arrow_data) .with_context("rerun.components.OutOfTreeTransform3D#repr")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.OutOfTreeTransform3D#repr") .with_context("rerun.components.OutOfTreeTransform3D")?) } diff --git a/crates/re_types/src/components/pinhole_projection.rs b/crates/re_types/src/components/pinhole_projection.rs index d390370dbd0d..97f9909724e0 100644 --- a/crates/re_types/src/components/pinhole_projection.rs +++ b/crates/re_types/src/components/pinhole_projection.rs @@ -64,8 +64,8 @@ impl<'a> From<&'a PinholeProjection> for ::std::borrow::Cow<'a, PinholeProjectio } } -impl crate::Loggable for PinholeProjection { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for PinholeProjection { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -90,13 +90,13 @@ impl crate::Loggable for PinholeProjection { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -158,19 +158,19 @@ impl crate::Loggable for PinholeProjection { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -196,7 +196,7 @@ impl crate::Loggable for PinholeProjection { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -214,7 +214,7 @@ impl crate::Loggable for PinholeProjection { elem.map(|(start, end)| { debug_assert!(end - start == 9usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -232,13 +232,13 @@ impl crate::Loggable for PinholeProjection { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Mat3x3(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.PinholeProjection#image_from_camera") .with_context("rerun.components.PinholeProjection")?) } @@ -247,16 +247,16 @@ impl crate::Loggable for PinholeProjection { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -265,7 +265,7 @@ impl crate::Loggable for PinholeProjection { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -285,7 +285,7 @@ impl crate::Loggable for PinholeProjection { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/position2d.rs b/crates/re_types/src/components/position2d.rs index 5a3698efaa76..1b0dd92eb4d5 100644 --- a/crates/re_types/src/components/position2d.rs +++ b/crates/re_types/src/components/position2d.rs @@ -55,8 +55,8 @@ impl<'a> From<&'a Position2D> for ::std::borrow::Cow<'a, Position2D> { } } -impl crate::Loggable for Position2D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Position2D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -81,13 +81,13 @@ impl crate::Loggable for Position2D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -149,19 +149,19 @@ impl crate::Loggable for Position2D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -187,7 +187,7 @@ impl crate::Loggable for Position2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -205,7 +205,7 @@ impl crate::Loggable for Position2D { elem.map(|(start, end)| { debug_assert!(end - start == 2usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -223,13 +223,13 @@ impl crate::Loggable for Position2D { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Vec2D(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Position2D#xy") .with_context("rerun.components.Position2D")?) } @@ -238,16 +238,16 @@ impl crate::Loggable for Position2D { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -256,7 +256,7 @@ impl crate::Loggable for Position2D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -276,7 +276,7 @@ impl crate::Loggable for Position2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/position3d.rs b/crates/re_types/src/components/position3d.rs index 4e1bbe20a949..aa5d6797a04c 100644 --- a/crates/re_types/src/components/position3d.rs +++ b/crates/re_types/src/components/position3d.rs @@ -55,8 +55,8 @@ impl<'a> From<&'a Position3D> for ::std::borrow::Cow<'a, Position3D> { } } -impl crate::Loggable for Position3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Position3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -81,13 +81,13 @@ impl crate::Loggable for Position3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -149,19 +149,19 @@ impl crate::Loggable for Position3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -187,7 +187,7 @@ impl crate::Loggable for Position3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -205,7 +205,7 @@ impl crate::Loggable for Position3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -223,13 +223,13 @@ impl crate::Loggable for Position3D { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Vec3D(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Position3D#xyz") .with_context("rerun.components.Position3D")?) } @@ -238,16 +238,16 @@ impl crate::Loggable for Position3D { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -256,7 +256,7 @@ impl crate::Loggable for Position3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -276,7 +276,7 @@ impl crate::Loggable for Position3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/radius.rs b/crates/re_types/src/components/radius.rs index 680d0b8757ea..52152bcc1fc8 100644 --- a/crates/re_types/src/components/radius.rs +++ b/crates/re_types/src/components/radius.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a Radius> for ::std::borrow::Cow<'a, Radius> { } } -impl crate::Loggable for Radius { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Radius { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -65,13 +65,13 @@ impl crate::Loggable for Radius { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -100,18 +100,18 @@ impl crate::Loggable for Radius { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -119,9 +119,9 @@ impl crate::Loggable for Radius { .with_context("rerun.components.Radius#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Radius#value") .with_context("rerun.components.Radius")?) } @@ -130,16 +130,16 @@ impl crate::Loggable for Radius { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -147,7 +147,7 @@ impl crate::Loggable for Radius { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/resolution.rs b/crates/re_types/src/components/resolution.rs index 80a83237054d..3b2d951f38ca 100644 --- a/crates/re_types/src/components/resolution.rs +++ b/crates/re_types/src/components/resolution.rs @@ -56,8 +56,8 @@ impl<'a> From<&'a Resolution> for ::std::borrow::Cow<'a, Resolution> { } } -impl crate::Loggable for Resolution { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Resolution { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -82,13 +82,13 @@ impl crate::Loggable for Resolution { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -150,19 +150,19 @@ impl crate::Loggable for Resolution { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -188,7 +188,7 @@ impl crate::Loggable for Resolution { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -206,7 +206,7 @@ impl crate::Loggable for Resolution { elem.map(|(start, end)| { debug_assert!(end - start == 2usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -224,13 +224,13 @@ impl crate::Loggable for Resolution { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Vec2D(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Resolution#resolution") .with_context("rerun.components.Resolution")?) } @@ -239,16 +239,16 @@ impl crate::Loggable for Resolution { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -257,7 +257,7 @@ impl crate::Loggable for Resolution { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -277,7 +277,7 @@ impl crate::Loggable for Resolution { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/rotation3d.rs b/crates/re_types/src/components/rotation3d.rs index ee3324df220b..ce098d48b3cd 100644 --- a/crates/re_types/src/components/rotation3d.rs +++ b/crates/re_types/src/components/rotation3d.rs @@ -57,8 +57,8 @@ impl<'a> From<&'a Rotation3D> for ::std::borrow::Cow<'a, Rotation3D> { } } -impl crate::Loggable for Rotation3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Rotation3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -98,13 +98,13 @@ impl crate::Loggable for Rotation3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -131,19 +131,19 @@ impl crate::Loggable for Rotation3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(crate::datatypes::Rotation3D::from_arrow_opt(arrow_data) .with_context("rerun.components.Rotation3D#repr")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Rotation3D#repr") .with_context("rerun.components.Rotation3D")?) } diff --git a/crates/re_types/src/components/scalar.rs b/crates/re_types/src/components/scalar.rs index ce3513fbe761..c26293d19654 100644 --- a/crates/re_types/src/components/scalar.rs +++ b/crates/re_types/src/components/scalar.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a Scalar> for ::std::borrow::Cow<'a, Scalar> { } } -impl crate::Loggable for Scalar { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Scalar { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -67,13 +67,13 @@ impl crate::Loggable for Scalar { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -102,18 +102,18 @@ impl crate::Loggable for Scalar { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float64, arrow_data.data_type().clone(), ) @@ -121,9 +121,9 @@ impl crate::Loggable for Scalar { .with_context("rerun.components.Scalar#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Scalar#value") .with_context("rerun.components.Scalar")?) } @@ -132,16 +132,16 @@ impl crate::Loggable for Scalar { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -149,7 +149,7 @@ impl crate::Loggable for Scalar { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float64, arrow_data.data_type().clone(), ) diff --git a/crates/re_types/src/components/scalar_scattering.rs b/crates/re_types/src/components/scalar_scattering.rs index d432e842cd96..1a38a5fcd645 100644 --- a/crates/re_types/src/components/scalar_scattering.rs +++ b/crates/re_types/src/components/scalar_scattering.rs @@ -46,8 +46,8 @@ impl<'a> From<&'a ScalarScattering> for ::std::borrow::Cow<'a, ScalarScattering> } } -impl crate::Loggable for ScalarScattering { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for ScalarScattering { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -64,13 +64,13 @@ impl crate::Loggable for ScalarScattering { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -99,27 +99,27 @@ impl crate::Loggable for ScalarScattering { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) }) .with_context("rerun.components.ScalarScattering#scattered")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.ScalarScattering#scattered") .with_context("rerun.components.ScalarScattering")?) } diff --git a/crates/re_types/src/components/tensor_data.rs b/crates/re_types/src/components/tensor_data.rs index 6057b4d75bab..75b6c849f9b5 100644 --- a/crates/re_types/src/components/tensor_data.rs +++ b/crates/re_types/src/components/tensor_data.rs @@ -55,8 +55,8 @@ impl<'a> From<&'a TensorData> for ::std::borrow::Cow<'a, TensorData> { } } -impl crate::Loggable for TensorData { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for TensorData { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -91,13 +91,13 @@ impl crate::Loggable for TensorData { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -124,19 +124,19 @@ impl crate::Loggable for TensorData { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(crate::datatypes::TensorData::from_arrow_opt(arrow_data) .with_context("rerun.components.TensorData#data")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.TensorData#data") .with_context("rerun.components.TensorData")?) } diff --git a/crates/re_types/src/components/text.rs b/crates/re_types/src/components/text.rs index e8932c17f9c4..bc0f5fb86401 100644 --- a/crates/re_types/src/components/text.rs +++ b/crates/re_types/src/components/text.rs @@ -55,8 +55,8 @@ impl<'a> From<&'a Text> for ::std::borrow::Cow<'a, Text> { } } -impl crate::Loggable for Text { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Text { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for Text { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -134,19 +134,19 @@ impl crate::Loggable for Text { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -163,7 +163,7 @@ impl crate::Loggable for Text { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -177,16 +177,16 @@ impl crate::Loggable for Text { }) .map(|res_or_opt| { res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| crate::datatypes::Utf8(crate::ArrowString(v))) + res_or_opt.map(|v| crate::datatypes::Utf8(::re_types_core::ArrowString(v))) }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Text#value")? .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Text#value") .with_context("rerun.components.Text")?) } diff --git a/crates/re_types/src/components/text_log_level.rs b/crates/re_types/src/components/text_log_level.rs index b7a2cac512e3..1225add9b14c 100644 --- a/crates/re_types/src/components/text_log_level.rs +++ b/crates/re_types/src/components/text_log_level.rs @@ -63,8 +63,8 @@ impl<'a> From<&'a TextLogLevel> for ::std::borrow::Cow<'a, TextLogLevel> { } } -impl crate::Loggable for TextLogLevel { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for TextLogLevel { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -81,13 +81,13 @@ impl crate::Loggable for TextLogLevel { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -142,19 +142,19 @@ impl crate::Loggable for TextLogLevel { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -171,7 +171,7 @@ impl crate::Loggable for TextLogLevel { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -185,16 +185,16 @@ impl crate::Loggable for TextLogLevel { }) .map(|res_or_opt| { res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| crate::datatypes::Utf8(crate::ArrowString(v))) + res_or_opt.map(|v| crate::datatypes::Utf8(::re_types_core::ArrowString(v))) }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.TextLogLevel#value")? .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.TextLogLevel#value") .with_context("rerun.components.TextLogLevel")?) } diff --git a/crates/re_types/src/components/transform3d.rs b/crates/re_types/src/components/transform3d.rs index 4041c9e48076..d208cab42a02 100644 --- a/crates/re_types/src/components/transform3d.rs +++ b/crates/re_types/src/components/transform3d.rs @@ -57,8 +57,8 @@ impl<'a> From<&'a Transform3D> for ::std::borrow::Cow<'a, Transform3D> { } } -impl crate::Loggable for Transform3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Transform3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -98,13 +98,13 @@ impl crate::Loggable for Transform3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -131,19 +131,19 @@ impl crate::Loggable for Transform3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(crate::datatypes::Transform3D::from_arrow_opt(arrow_data) .with_context("rerun.components.Transform3D#repr")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Transform3D#repr") .with_context("rerun.components.Transform3D")?) } diff --git a/crates/re_types/src/components/vector3d.rs b/crates/re_types/src/components/vector3d.rs index 7c7699351f23..4a6f7be4fdd3 100644 --- a/crates/re_types/src/components/vector3d.rs +++ b/crates/re_types/src/components/vector3d.rs @@ -55,8 +55,8 @@ impl<'a> From<&'a Vector3D> for ::std::borrow::Cow<'a, Vector3D> { } } -impl crate::Loggable for Vector3D { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for Vector3D { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -81,13 +81,13 @@ impl crate::Loggable for Vector3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -149,19 +149,19 @@ impl crate::Loggable for Vector3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -187,7 +187,7 @@ impl crate::Loggable for Vector3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -205,7 +205,7 @@ impl crate::Loggable for Vector3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -223,13 +223,13 @@ impl crate::Loggable for Vector3D { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::datatypes::Vec3D(v))) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.Vector3D#vector") .with_context("rerun.components.Vector3D")?) } @@ -238,16 +238,16 @@ impl crate::Loggable for Vector3D { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -256,7 +256,7 @@ impl crate::Loggable for Vector3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -276,7 +276,7 @@ impl crate::Loggable for Vector3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/components/view_coordinates.rs b/crates/re_types/src/components/view_coordinates.rs index 978a6ebb7b2f..b32ddfe8f051 100644 --- a/crates/re_types/src/components/view_coordinates.rs +++ b/crates/re_types/src/components/view_coordinates.rs @@ -65,8 +65,8 @@ impl<'a> From<&'a ViewCoordinates> for ::std::borrow::Cow<'a, ViewCoordinates> { } } -impl crate::Loggable for ViewCoordinates { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for ViewCoordinates { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -91,13 +91,13 @@ impl crate::Loggable for ViewCoordinates { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -153,19 +153,19 @@ impl crate::Loggable for ViewCoordinates { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -191,7 +191,7 @@ impl crate::Loggable for ViewCoordinates { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt8, arrow_data_inner.data_type().clone(), ) @@ -209,7 +209,7 @@ impl crate::Loggable for ViewCoordinates { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -224,13 +224,13 @@ impl crate::Loggable for ViewCoordinates { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.components.ViewCoordinates#coordinates") .with_context("rerun.components.ViewCoordinates")?) } @@ -239,16 +239,16 @@ impl crate::Loggable for ViewCoordinates { #[inline] fn from_arrow( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult> + ) -> ::re_types_core::DeserializationResult> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } Ok({ @@ -257,7 +257,7 @@ impl crate::Loggable for ViewCoordinates { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -277,7 +277,7 @@ impl crate::Loggable for ViewCoordinates { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt8, arrow_data_inner.data_type().clone(), ) diff --git a/crates/re_types/src/datatypes/angle.rs b/crates/re_types/src/datatypes/angle.rs index df9e5c47dbd6..c96ddf4244d3 100644 --- a/crates/re_types/src/datatypes/angle.rs +++ b/crates/re_types/src/datatypes/angle.rs @@ -35,8 +35,8 @@ impl<'a> From<&'a Angle> for ::std::borrow::Cow<'a, Angle> { } } -impl crate::Loggable for Angle { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Angle { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -76,13 +76,13 @@ impl crate::Loggable for Angle { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -182,19 +182,19 @@ impl crate::Loggable for Angle { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { @@ -231,14 +231,14 @@ impl crate::Loggable for Angle { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.datatypes.Angle")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -253,7 +253,7 @@ impl crate::Loggable for Angle { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -272,7 +272,7 @@ impl crate::Loggable for Angle { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -293,46 +293,56 @@ impl crate::Loggable for Angle { Ok(Some(match typ { 1i8 => Angle::Radians({ if offset as usize >= radians.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - radians.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + radians.len(), + ), + ) .with_context("rerun.datatypes.Angle#Radians"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { radians.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.Angle#Radians")? }), 2i8 => Angle::Degrees({ if offset as usize >= degrees.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - degrees.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + degrees.len(), + ), + ) .with_context("rerun.datatypes.Angle#Degrees"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { degrees.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.Angle#Degrees")? }), _ => { - return Err(crate::DeserializationError::missing_union_arm( - Self::arrow_datatype(), - "", - *typ as _, - )) + return Err( + ::re_types_core::DeserializationError::missing_union_arm( + Self::arrow_datatype(), + "", + *typ as _, + ), + ) .with_context("rerun.datatypes.Angle"); } })) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.Angle")? } }) diff --git a/crates/re_types/src/datatypes/annotation_info.rs b/crates/re_types/src/datatypes/annotation_info.rs index 1c3124a53a0f..e049b14fc224 100644 --- a/crates/re_types/src/datatypes/annotation_info.rs +++ b/crates/re_types/src/datatypes/annotation_info.rs @@ -44,8 +44,8 @@ impl<'a> From<&'a AnnotationInfo> for ::std::borrow::Cow<'a, AnnotationInfo> { } } -impl crate::Loggable for AnnotationInfo { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AnnotationInfo { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -81,13 +81,13 @@ impl crate::Loggable for AnnotationInfo { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -222,19 +222,19 @@ impl crate::Loggable for AnnotationInfo { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "id".to_owned(), @@ -271,7 +271,7 @@ impl crate::Loggable for AnnotationInfo { .collect(); let id = { if !arrays_by_name.contains_key("id") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "id", )) @@ -282,7 +282,7 @@ impl crate::Loggable for AnnotationInfo { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -293,7 +293,7 @@ impl crate::Loggable for AnnotationInfo { }; let label = { if !arrays_by_name.contains_key("label") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "label", )) @@ -305,7 +305,7 @@ impl crate::Loggable for AnnotationInfo { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -322,10 +322,12 @@ impl crate::Loggable for AnnotationInfo { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -337,17 +339,19 @@ impl crate::Loggable for AnnotationInfo { }) .map(|res_or_opt| { res_or_opt.map(|res_or_opt| { - res_or_opt.map(|v| crate::datatypes::Utf8(crate::ArrowString(v))) + res_or_opt.map(|v| { + crate::datatypes::Utf8(::re_types_core::ArrowString(v)) + }) }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.AnnotationInfo#label")? .into_iter() } }; let color = { if !arrays_by_name.contains_key("color") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "color", )) @@ -358,7 +362,7 @@ impl crate::Loggable for AnnotationInfo { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) @@ -376,7 +380,7 @@ impl crate::Loggable for AnnotationInfo { opt.map(|(id, label, color)| { Ok(Self { id: id - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.AnnotationInfo#id")?, label, color, @@ -384,7 +388,7 @@ impl crate::Loggable for AnnotationInfo { }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.AnnotationInfo")? } }) diff --git a/crates/re_types/src/datatypes/class_description.rs b/crates/re_types/src/datatypes/class_description.rs index 726d5c60db2b..a4198b04ee76 100644 --- a/crates/re_types/src/datatypes/class_description.rs +++ b/crates/re_types/src/datatypes/class_description.rs @@ -54,8 +54,8 @@ impl<'a> From<&'a ClassDescription> for ::std::borrow::Cow<'a, ClassDescription> } } -impl crate::Loggable for ClassDescription { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for ClassDescription { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -101,13 +101,13 @@ impl crate::Loggable for ClassDescription { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -265,19 +265,19 @@ impl crate::Loggable for ClassDescription { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "info".to_owned(), @@ -324,7 +324,7 @@ impl crate::Loggable for ClassDescription { .collect(); let info = { if !arrays_by_name.contains_key("info") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "info", )) @@ -337,7 +337,7 @@ impl crate::Loggable for ClassDescription { }; let keypoint_annotations = { if !arrays_by_name.contains_key("keypoint_annotations") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "keypoint_annotations", )) @@ -349,7 +349,7 @@ impl crate::Loggable for ClassDescription { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: @@ -385,10 +385,12 @@ impl crate::Loggable for ClassDescription { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -404,14 +406,14 @@ impl crate::Loggable for ClassDescription { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let keypoint_connections = { if !arrays_by_name.contains_key("keypoint_connections") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "keypoint_connections", )) @@ -423,7 +425,7 @@ impl crate::Loggable for ClassDescription { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype( @@ -459,10 +461,12 @@ impl crate::Loggable for ClassDescription { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -478,7 +482,7 @@ impl crate::Loggable for ClassDescription { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -491,15 +495,15 @@ impl crate::Loggable for ClassDescription { opt.map(|(info, keypoint_annotations, keypoint_connections)| { Ok(Self { info: info - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.ClassDescription#info")?, keypoint_annotations: keypoint_annotations - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.datatypes.ClassDescription#keypoint_annotations", )?, keypoint_connections: keypoint_connections - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.datatypes.ClassDescription#keypoint_connections", )?, @@ -507,7 +511,7 @@ impl crate::Loggable for ClassDescription { }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.ClassDescription")? } }) diff --git a/crates/re_types/src/datatypes/class_description_map_elem.rs b/crates/re_types/src/datatypes/class_description_map_elem.rs index ac1130c631f1..ca9d74bd2c0f 100644 --- a/crates/re_types/src/datatypes/class_description_map_elem.rs +++ b/crates/re_types/src/datatypes/class_description_map_elem.rs @@ -40,8 +40,8 @@ impl<'a> From<&'a ClassDescriptionMapElem> for ::std::borrow::Cow<'a, ClassDescr } } -impl crate::Loggable for ClassDescriptionMapElem { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for ClassDescriptionMapElem { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -71,13 +71,13 @@ impl crate::Loggable for ClassDescriptionMapElem { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -157,19 +157,19 @@ impl crate::Loggable for ClassDescriptionMapElem { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "class_id".to_owned(), @@ -200,7 +200,7 @@ impl crate::Loggable for ClassDescriptionMapElem { .collect(); let class_id = { if !arrays_by_name.contains_key("class_id") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "class_id", )) @@ -211,7 +211,7 @@ impl crate::Loggable for ClassDescriptionMapElem { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -223,7 +223,7 @@ impl crate::Loggable for ClassDescriptionMapElem { }; let class_description = { if !arrays_by_name.contains_key("class_description") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "class_description", )) @@ -242,10 +242,10 @@ impl crate::Loggable for ClassDescriptionMapElem { opt.map(|(class_id, class_description)| { Ok(Self { class_id: class_id - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.ClassDescriptionMapElem#class_id")?, class_description: class_description - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.datatypes.ClassDescriptionMapElem#class_description", )?, @@ -253,7 +253,7 @@ impl crate::Loggable for ClassDescriptionMapElem { }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.ClassDescriptionMapElem")? } }) diff --git a/crates/re_types/src/datatypes/class_id.rs b/crates/re_types/src/datatypes/class_id.rs index 06163b114ad5..ad0eb8017590 100644 --- a/crates/re_types/src/datatypes/class_id.rs +++ b/crates/re_types/src/datatypes/class_id.rs @@ -62,8 +62,8 @@ impl<'a> From<&'a ClassId> for ::std::borrow::Cow<'a, ClassId> { } } -impl crate::Loggable for ClassId { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for ClassId { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -80,13 +80,13 @@ impl crate::Loggable for ClassId { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -115,18 +115,18 @@ impl crate::Loggable for ClassId { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -134,9 +134,9 @@ impl crate::Loggable for ClassId { .with_context("rerun.datatypes.ClassId#id")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.ClassId#id") .with_context("rerun.datatypes.ClassId")?) } diff --git a/crates/re_types/src/datatypes/float32.rs b/crates/re_types/src/datatypes/float32.rs index e65d9f1d1b3d..0c3f90e7e435 100644 --- a/crates/re_types/src/datatypes/float32.rs +++ b/crates/re_types/src/datatypes/float32.rs @@ -46,8 +46,8 @@ impl<'a> From<&'a Float32> for ::std::borrow::Cow<'a, Float32> { } } -impl crate::Loggable for Float32 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Float32 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -64,13 +64,13 @@ impl crate::Loggable for Float32 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -99,18 +99,18 @@ impl crate::Loggable for Float32 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -118,9 +118,9 @@ impl crate::Loggable for Float32 { .with_context("rerun.datatypes.Float32#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Float32#value") .with_context("rerun.datatypes.Float32")?) } diff --git a/crates/re_types/src/datatypes/keypoint_id.rs b/crates/re_types/src/datatypes/keypoint_id.rs index fd77e0ec1bd2..1ad7eda03a0f 100644 --- a/crates/re_types/src/datatypes/keypoint_id.rs +++ b/crates/re_types/src/datatypes/keypoint_id.rs @@ -64,8 +64,8 @@ impl<'a> From<&'a KeypointId> for ::std::borrow::Cow<'a, KeypointId> { } } -impl crate::Loggable for KeypointId { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for KeypointId { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -82,13 +82,13 @@ impl crate::Loggable for KeypointId { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -117,18 +117,18 @@ impl crate::Loggable for KeypointId { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -136,9 +136,9 @@ impl crate::Loggable for KeypointId { .with_context("rerun.datatypes.KeypointId#id")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.KeypointId#id") .with_context("rerun.datatypes.KeypointId")?) } diff --git a/crates/re_types/src/datatypes/keypoint_pair.rs b/crates/re_types/src/datatypes/keypoint_pair.rs index a95d48bb28e3..f47291f71210 100644 --- a/crates/re_types/src/datatypes/keypoint_pair.rs +++ b/crates/re_types/src/datatypes/keypoint_pair.rs @@ -38,8 +38,8 @@ impl<'a> From<&'a KeypointPair> for ::std::borrow::Cow<'a, KeypointPair> { } } -impl crate::Loggable for KeypointPair { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for KeypointPair { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -69,13 +69,13 @@ impl crate::Loggable for KeypointPair { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -165,19 +165,19 @@ impl crate::Loggable for KeypointPair { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "keypoint0".to_owned(), @@ -208,7 +208,7 @@ impl crate::Loggable for KeypointPair { .collect(); let keypoint0 = { if !arrays_by_name.contains_key("keypoint0") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "keypoint0", )) @@ -219,7 +219,7 @@ impl crate::Loggable for KeypointPair { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -231,7 +231,7 @@ impl crate::Loggable for KeypointPair { }; let keypoint1 = { if !arrays_by_name.contains_key("keypoint1") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "keypoint1", )) @@ -242,7 +242,7 @@ impl crate::Loggable for KeypointPair { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data.data_type().clone(), ) @@ -260,16 +260,16 @@ impl crate::Loggable for KeypointPair { opt.map(|(keypoint0, keypoint1)| { Ok(Self { keypoint0: keypoint0 - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.KeypointPair#keypoint0")?, keypoint1: keypoint1 - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.KeypointPair#keypoint1")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.KeypointPair")? } }) diff --git a/crates/re_types/src/datatypes/mat3x3.rs b/crates/re_types/src/datatypes/mat3x3.rs index b9be37a9cd05..ad9ac77671d9 100644 --- a/crates/re_types/src/datatypes/mat3x3.rs +++ b/crates/re_types/src/datatypes/mat3x3.rs @@ -58,8 +58,8 @@ impl<'a> From<&'a Mat3x3> for ::std::borrow::Cow<'a, Mat3x3> { } } -impl crate::Loggable for Mat3x3 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Mat3x3 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -84,13 +84,13 @@ impl crate::Loggable for Mat3x3 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -146,19 +146,19 @@ impl crate::Loggable for Mat3x3 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -184,7 +184,7 @@ impl crate::Loggable for Mat3x3 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -202,7 +202,7 @@ impl crate::Loggable for Mat3x3 { elem.map(|(start, end)| { debug_assert!(end - start == 9usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -217,13 +217,13 @@ impl crate::Loggable for Mat3x3 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Mat3x3#flat_columns") .with_context("rerun.datatypes.Mat3x3")?) } diff --git a/crates/re_types/src/datatypes/mat4x4.rs b/crates/re_types/src/datatypes/mat4x4.rs index d44140e7b3e8..1ecba20dd2fb 100644 --- a/crates/re_types/src/datatypes/mat4x4.rs +++ b/crates/re_types/src/datatypes/mat4x4.rs @@ -59,8 +59,8 @@ impl<'a> From<&'a Mat4x4> for ::std::borrow::Cow<'a, Mat4x4> { } } -impl crate::Loggable for Mat4x4 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Mat4x4 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -85,13 +85,13 @@ impl crate::Loggable for Mat4x4 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -147,19 +147,19 @@ impl crate::Loggable for Mat4x4 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -185,7 +185,7 @@ impl crate::Loggable for Mat4x4 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -203,7 +203,7 @@ impl crate::Loggable for Mat4x4 { elem.map(|(start, end)| { debug_assert!(end - start == 16usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -218,13 +218,13 @@ impl crate::Loggable for Mat4x4 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Mat4x4#flat_columns") .with_context("rerun.datatypes.Mat4x4")?) } diff --git a/crates/re_types/src/datatypes/material.rs b/crates/re_types/src/datatypes/material.rs index 56a8d563f392..8ae97a90c49a 100644 --- a/crates/re_types/src/datatypes/material.rs +++ b/crates/re_types/src/datatypes/material.rs @@ -59,8 +59,8 @@ impl<'a> From<&'a Material> for ::std::borrow::Cow<'a, Material> { } } -impl crate::Loggable for Material { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Material { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -82,13 +82,13 @@ impl crate::Loggable for Material { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -147,19 +147,19 @@ impl crate::Loggable for Material { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![Field { name: "albedo_factor".to_owned(), data_type: ::arrow_datatype(), @@ -182,7 +182,7 @@ impl crate::Loggable for Material { .collect(); let albedo_factor = { if !arrays_by_name.contains_key("albedo_factor") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "albedo_factor", )) @@ -193,7 +193,7 @@ impl crate::Loggable for Material { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) @@ -211,7 +211,7 @@ impl crate::Loggable for Material { opt.map(|(albedo_factor)| Ok(Self { albedo_factor })) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.Material")? } }) diff --git a/crates/re_types/src/datatypes/mesh_properties.rs b/crates/re_types/src/datatypes/mesh_properties.rs index a7347c15f42c..c0a2a4725bcd 100644 --- a/crates/re_types/src/datatypes/mesh_properties.rs +++ b/crates/re_types/src/datatypes/mesh_properties.rs @@ -20,17 +20,17 @@ pub struct MeshProperties { /// A flattened array of vertex indices that describe the mesh's triangles. /// /// Its length must be divisible by 3. - pub indices: Option>, + pub indices: Option<::re_types_core::ArrowBuffer>, } -impl From>> for MeshProperties { +impl From>> for MeshProperties { #[inline] - fn from(indices: Option>) -> Self { + fn from(indices: Option<::re_types_core::ArrowBuffer>) -> Self { Self { indices } } } -impl From for Option> { +impl From for Option<::re_types_core::ArrowBuffer> { #[inline] fn from(value: MeshProperties) -> Self { value.indices @@ -51,8 +51,8 @@ impl<'a> From<&'a MeshProperties> for ::std::borrow::Cow<'a, MeshProperties> { } } -impl crate::Loggable for MeshProperties { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for MeshProperties { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -79,13 +79,13 @@ impl crate::Loggable for MeshProperties { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -165,19 +165,19 @@ impl crate::Loggable for MeshProperties { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![Field { name: "indices".to_owned(), data_type: DataType::List(Box::new(Field { @@ -205,7 +205,7 @@ impl crate::Loggable for MeshProperties { .collect(); let indices = { if !arrays_by_name.contains_key("indices") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "indices", )) @@ -217,7 +217,7 @@ impl crate::Loggable for MeshProperties { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, @@ -237,7 +237,7 @@ impl crate::Loggable for MeshProperties { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data_inner.data_type().clone(), ) @@ -255,10 +255,12 @@ impl crate::Loggable for MeshProperties { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -267,12 +269,12 @@ impl crate::Loggable for MeshProperties { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -282,7 +284,7 @@ impl crate::Loggable for MeshProperties { arrow_data.validity(), ) .map(|opt| opt.map(|(indices)| Ok(Self { indices })).transpose()) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.MeshProperties")? } }) diff --git a/crates/re_types/src/datatypes/quaternion.rs b/crates/re_types/src/datatypes/quaternion.rs index 19811b94bc39..23eae8930720 100644 --- a/crates/re_types/src/datatypes/quaternion.rs +++ b/crates/re_types/src/datatypes/quaternion.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a Quaternion> for ::std::borrow::Cow<'a, Quaternion> { } } -impl crate::Loggable for Quaternion { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Quaternion { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -75,13 +75,13 @@ impl crate::Loggable for Quaternion { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -137,19 +137,19 @@ impl crate::Loggable for Quaternion { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -175,7 +175,7 @@ impl crate::Loggable for Quaternion { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -193,7 +193,7 @@ impl crate::Loggable for Quaternion { elem.map(|(start, end)| { debug_assert!(end - start == 4usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -208,13 +208,13 @@ impl crate::Loggable for Quaternion { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Quaternion#xyzw") .with_context("rerun.datatypes.Quaternion")?) } diff --git a/crates/re_types/src/datatypes/rgba32.rs b/crates/re_types/src/datatypes/rgba32.rs index dbde62afb44f..ecd0a600a58a 100644 --- a/crates/re_types/src/datatypes/rgba32.rs +++ b/crates/re_types/src/datatypes/rgba32.rs @@ -52,8 +52,8 @@ impl<'a> From<&'a Rgba32> for ::std::borrow::Cow<'a, Rgba32> { } } -impl crate::Loggable for Rgba32 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Rgba32 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -70,13 +70,13 @@ impl crate::Loggable for Rgba32 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -105,18 +105,18 @@ impl crate::Loggable for Rgba32 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) @@ -124,9 +124,9 @@ impl crate::Loggable for Rgba32 { .with_context("rerun.datatypes.Rgba32#rgba")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Rgba32#rgba") .with_context("rerun.datatypes.Rgba32")?) } diff --git a/crates/re_types/src/datatypes/rotation3d.rs b/crates/re_types/src/datatypes/rotation3d.rs index 77778362e0cc..77408660de30 100644 --- a/crates/re_types/src/datatypes/rotation3d.rs +++ b/crates/re_types/src/datatypes/rotation3d.rs @@ -38,8 +38,8 @@ impl<'a> From<&'a Rotation3D> for ::std::borrow::Cow<'a, Rotation3D> { } } -impl crate::Loggable for Rotation3D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Rotation3D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -79,13 +79,13 @@ impl crate::Loggable for Rotation3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -228,19 +228,19 @@ impl crate::Loggable for Rotation3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { @@ -278,14 +278,14 @@ impl crate::Loggable for Rotation3D { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.datatypes.Rotation3D")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -301,7 +301,7 @@ impl crate::Loggable for Rotation3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -327,7 +327,7 @@ impl crate::Loggable for Rotation3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -345,10 +345,12 @@ impl crate::Loggable for Rotation3D { elem.map(|(start, end)| { debug_assert!(end - start == 4usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -366,7 +368,7 @@ impl crate::Loggable for Rotation3D { res_or_opt.map(|v| crate::datatypes::Quaternion(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -393,46 +395,56 @@ impl crate::Loggable for Rotation3D { Ok(Some(match typ { 1i8 => Rotation3D::Quaternion({ if offset as usize >= quaternion.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - quaternion.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + quaternion.len(), + ), + ) .with_context("rerun.datatypes.Rotation3D#Quaternion"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { quaternion.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.Rotation3D#Quaternion")? }), 2i8 => Rotation3D::AxisAngle({ if offset as usize >= axis_angle.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - axis_angle.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + axis_angle.len(), + ), + ) .with_context("rerun.datatypes.Rotation3D#AxisAngle"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { axis_angle.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.Rotation3D#AxisAngle")? }), _ => { - return Err(crate::DeserializationError::missing_union_arm( - Self::arrow_datatype(), - "", - *typ as _, - )) + return Err( + ::re_types_core::DeserializationError::missing_union_arm( + Self::arrow_datatype(), + "", + *typ as _, + ), + ) .with_context("rerun.datatypes.Rotation3D"); } })) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.Rotation3D")? } }) diff --git a/crates/re_types/src/datatypes/rotation_axis_angle.rs b/crates/re_types/src/datatypes/rotation_axis_angle.rs index 6c96d1c469d6..56669afaaba0 100644 --- a/crates/re_types/src/datatypes/rotation_axis_angle.rs +++ b/crates/re_types/src/datatypes/rotation_axis_angle.rs @@ -42,8 +42,8 @@ impl<'a> From<&'a RotationAxisAngle> for ::std::borrow::Cow<'a, RotationAxisAngl } } -impl crate::Loggable for RotationAxisAngle { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for RotationAxisAngle { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for RotationAxisAngle { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -188,19 +188,19 @@ impl crate::Loggable for RotationAxisAngle { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "axis".to_owned(), @@ -231,7 +231,7 @@ impl crate::Loggable for RotationAxisAngle { .collect(); let axis = { if !arrays_by_name.contains_key("axis") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "axis", )) @@ -243,7 +243,7 @@ impl crate::Loggable for RotationAxisAngle { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -269,7 +269,7 @@ impl crate::Loggable for RotationAxisAngle { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -287,10 +287,12 @@ impl crate::Loggable for RotationAxisAngle { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -308,14 +310,14 @@ impl crate::Loggable for RotationAxisAngle { res_or_opt.map(|v| crate::datatypes::Vec3D(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let angle = { if !arrays_by_name.contains_key("angle") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "angle", )) @@ -334,16 +336,16 @@ impl crate::Loggable for RotationAxisAngle { opt.map(|(axis, angle)| { Ok(Self { axis: axis - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.RotationAxisAngle#axis")?, angle: angle - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.RotationAxisAngle#angle")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.RotationAxisAngle")? } }) diff --git a/crates/re_types/src/datatypes/scale3d.rs b/crates/re_types/src/datatypes/scale3d.rs index 5308b50cb22e..95c9dbb8c50f 100644 --- a/crates/re_types/src/datatypes/scale3d.rs +++ b/crates/re_types/src/datatypes/scale3d.rs @@ -38,8 +38,8 @@ impl<'a> From<&'a Scale3D> for ::std::borrow::Cow<'a, Scale3D> { } } -impl crate::Loggable for Scale3D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Scale3D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -79,13 +79,13 @@ impl crate::Loggable for Scale3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -226,19 +226,19 @@ impl crate::Loggable for Scale3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { @@ -275,14 +275,14 @@ impl crate::Loggable for Scale3D { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.datatypes.Scale3D")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -298,7 +298,7 @@ impl crate::Loggable for Scale3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -324,7 +324,7 @@ impl crate::Loggable for Scale3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -342,10 +342,12 @@ impl crate::Loggable for Scale3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -363,7 +365,7 @@ impl crate::Loggable for Scale3D { res_or_opt.map(|v| crate::datatypes::Vec3D(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -378,7 +380,7 @@ impl crate::Loggable for Scale3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -399,46 +401,56 @@ impl crate::Loggable for Scale3D { Ok(Some(match typ { 1i8 => Scale3D::ThreeD({ if offset as usize >= three_d.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - three_d.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + three_d.len(), + ), + ) .with_context("rerun.datatypes.Scale3D#ThreeD"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { three_d.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.Scale3D#ThreeD")? }), 2i8 => Scale3D::Uniform({ if offset as usize >= uniform.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - uniform.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + uniform.len(), + ), + ) .with_context("rerun.datatypes.Scale3D#Uniform"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { uniform.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.Scale3D#Uniform")? }), _ => { - return Err(crate::DeserializationError::missing_union_arm( - Self::arrow_datatype(), - "", - *typ as _, - )) + return Err( + ::re_types_core::DeserializationError::missing_union_arm( + Self::arrow_datatype(), + "", + *typ as _, + ), + ) .with_context("rerun.datatypes.Scale3D"); } })) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.Scale3D")? } }) diff --git a/crates/re_types/src/datatypes/tensor_buffer.rs b/crates/re_types/src/datatypes/tensor_buffer.rs index 9d0dd2417a29..571fbe529f39 100644 --- a/crates/re_types/src/datatypes/tensor_buffer.rs +++ b/crates/re_types/src/datatypes/tensor_buffer.rs @@ -19,18 +19,18 @@ /// Tensor elements are stored in a contiguous buffer of a single type. #[derive(Clone, PartialEq)] pub enum TensorBuffer { - U8(crate::ArrowBuffer), - U16(crate::ArrowBuffer), - U32(crate::ArrowBuffer), - U64(crate::ArrowBuffer), - I8(crate::ArrowBuffer), - I16(crate::ArrowBuffer), - I32(crate::ArrowBuffer), - I64(crate::ArrowBuffer), - F16(crate::ArrowBuffer), - F32(crate::ArrowBuffer), - F64(crate::ArrowBuffer), - Jpeg(crate::ArrowBuffer), + U8(::re_types_core::ArrowBuffer), + U16(::re_types_core::ArrowBuffer), + U32(::re_types_core::ArrowBuffer), + U64(::re_types_core::ArrowBuffer), + I8(::re_types_core::ArrowBuffer), + I16(::re_types_core::ArrowBuffer), + I32(::re_types_core::ArrowBuffer), + I64(::re_types_core::ArrowBuffer), + F16(::re_types_core::ArrowBuffer), + F32(::re_types_core::ArrowBuffer), + F64(::re_types_core::ArrowBuffer), + Jpeg(::re_types_core::ArrowBuffer), } impl<'a> From for ::std::borrow::Cow<'a, TensorBuffer> { @@ -47,8 +47,8 @@ impl<'a> From<&'a TensorBuffer> for ::std::borrow::Cow<'a, TensorBuffer> { } } -impl crate::Loggable for TensorBuffer { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for TensorBuffer { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -210,13 +210,13 @@ impl crate::Loggable for TensorBuffer { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -984,19 +984,19 @@ impl crate::Loggable for TensorBuffer { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { @@ -1156,14 +1156,14 @@ impl crate::Loggable for TensorBuffer { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.datatypes.TensorBuffer")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -1179,7 +1179,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, @@ -1199,7 +1199,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt8, arrow_data_inner.data_type().clone(), ) @@ -1217,10 +1217,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1229,12 +1231,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1250,7 +1252,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt16, @@ -1270,7 +1272,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt16, arrow_data_inner.data_type().clone(), ) @@ -1288,10 +1290,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1300,12 +1304,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1321,7 +1325,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt32, @@ -1341,7 +1345,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data_inner.data_type().clone(), ) @@ -1359,10 +1363,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1371,12 +1377,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1392,7 +1398,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt64, @@ -1412,7 +1418,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt64, arrow_data_inner.data_type().clone(), ) @@ -1430,10 +1436,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1442,12 +1450,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1463,7 +1471,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Int8, @@ -1483,7 +1491,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Int8, arrow_data_inner.data_type().clone(), ) @@ -1501,10 +1509,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1513,12 +1523,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1534,7 +1544,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Int16, @@ -1554,7 +1564,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Int16, arrow_data_inner.data_type().clone(), ) @@ -1572,10 +1582,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1584,12 +1596,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1605,7 +1617,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Int32, @@ -1625,7 +1637,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Int32, arrow_data_inner.data_type().clone(), ) @@ -1643,10 +1655,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1655,12 +1669,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1676,7 +1690,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Int64, @@ -1696,7 +1710,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Int64, arrow_data_inner.data_type().clone(), ) @@ -1714,10 +1728,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1726,12 +1742,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1747,7 +1763,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float16, @@ -1767,7 +1783,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float16, arrow_data_inner.data_type().clone(), ) @@ -1785,10 +1801,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1797,12 +1815,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1818,7 +1836,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, @@ -1838,7 +1856,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -1856,10 +1874,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1868,12 +1888,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1889,7 +1909,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float64, @@ -1909,7 +1929,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float64, arrow_data_inner.data_type().clone(), ) @@ -1927,10 +1947,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -1939,12 +1961,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -1960,7 +1982,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::UInt8, @@ -1980,7 +2002,7 @@ impl crate::Loggable for TensorBuffer { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt8, arrow_data_inner.data_type().clone(), ) @@ -1998,10 +2020,12 @@ impl crate::Loggable for TensorBuffer { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -2010,12 +2034,12 @@ impl crate::Loggable for TensorBuffer { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -2032,196 +2056,246 @@ impl crate::Loggable for TensorBuffer { Ok(Some(match typ { 1i8 => TensorBuffer::U8({ if offset as usize >= u8.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - u8.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + u8.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#U8"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { u8.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#U8")? }), 2i8 => TensorBuffer::U16({ if offset as usize >= u16.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - u16.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + u16.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#U16"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { u16.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#U16")? }), 3i8 => TensorBuffer::U32({ if offset as usize >= u32.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - u32.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + u32.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#U32"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { u32.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#U32")? }), 4i8 => TensorBuffer::U64({ if offset as usize >= u64.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - u64.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + u64.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#U64"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { u64.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#U64")? }), 5i8 => TensorBuffer::I8({ if offset as usize >= i8.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - i8.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + i8.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#I8"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { i8.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#I8")? }), 6i8 => TensorBuffer::I16({ if offset as usize >= i16.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - i16.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + i16.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#I16"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { i16.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#I16")? }), 7i8 => TensorBuffer::I32({ if offset as usize >= i32.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - i32.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + i32.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#I32"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { i32.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#I32")? }), 8i8 => TensorBuffer::I64({ if offset as usize >= i64.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - i64.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + i64.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#I64"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { i64.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#I64")? }), 9i8 => TensorBuffer::F16({ if offset as usize >= f16.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - f16.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + f16.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#F16"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { f16.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#F16")? }), 10i8 => TensorBuffer::F32({ if offset as usize >= f32.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - f32.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + f32.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#F32"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { f32.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#F32")? }), 11i8 => TensorBuffer::F64({ if offset as usize >= f64.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - f64.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + f64.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#F64"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { f64.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#F64")? }), 12i8 => TensorBuffer::Jpeg({ if offset as usize >= jpeg.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - jpeg.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + jpeg.len(), + ), + ) .with_context("rerun.datatypes.TensorBuffer#JPEG"); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { jpeg.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context("rerun.datatypes.TensorBuffer#JPEG")? }), _ => { - return Err(crate::DeserializationError::missing_union_arm( - Self::arrow_datatype(), - "", - *typ as _, - )) + return Err( + ::re_types_core::DeserializationError::missing_union_arm( + Self::arrow_datatype(), + "", + *typ as _, + ), + ) .with_context("rerun.datatypes.TensorBuffer"); } })) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.TensorBuffer")? } }) diff --git a/crates/re_types/src/datatypes/tensor_data.rs b/crates/re_types/src/datatypes/tensor_data.rs index 81aa9d237bed..5437caa17e19 100644 --- a/crates/re_types/src/datatypes/tensor_data.rs +++ b/crates/re_types/src/datatypes/tensor_data.rs @@ -42,8 +42,8 @@ impl<'a> From<&'a TensorData> for ::std::borrow::Cow<'a, TensorData> { } } -impl crate::Loggable for TensorData { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for TensorData { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -78,13 +78,13 @@ impl crate::Loggable for TensorData { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -182,19 +182,19 @@ impl crate::Loggable for TensorData { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "shape".to_owned(), @@ -231,7 +231,7 @@ impl crate::Loggable for TensorData { .collect(); let shape = { if !arrays_by_name.contains_key("shape") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "shape", )) @@ -243,7 +243,7 @@ impl crate::Loggable for TensorData { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: @@ -275,10 +275,12 @@ impl crate::Loggable for TensorData { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -294,14 +296,14 @@ impl crate::Loggable for TensorData { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let buffer = { if !arrays_by_name.contains_key("buffer") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "buffer", )) @@ -320,16 +322,16 @@ impl crate::Loggable for TensorData { opt.map(|(shape, buffer)| { Ok(Self { shape: shape - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.TensorData#shape")?, buffer: buffer - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.TensorData#buffer")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.TensorData")? } }) diff --git a/crates/re_types/src/datatypes/tensor_dimension.rs b/crates/re_types/src/datatypes/tensor_dimension.rs index 24b7ff80aa42..b295d04467f1 100644 --- a/crates/re_types/src/datatypes/tensor_dimension.rs +++ b/crates/re_types/src/datatypes/tensor_dimension.rs @@ -21,7 +21,7 @@ pub struct TensorDimension { pub size: u64, /// The name of this dimension, e.g. "width", "height", "channel", "batch', …. - pub name: Option, + pub name: Option<::re_types_core::ArrowString>, } impl<'a> From for ::std::borrow::Cow<'a, TensorDimension> { @@ -38,8 +38,8 @@ impl<'a> From<&'a TensorDimension> for ::std::borrow::Cow<'a, TensorDimension> { } } -impl crate::Loggable for TensorDimension { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for TensorDimension { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -69,13 +69,13 @@ impl crate::Loggable for TensorDimension { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -163,19 +163,19 @@ impl crate::Loggable for TensorDimension { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "size".to_owned(), @@ -206,7 +206,7 @@ impl crate::Loggable for TensorDimension { .collect(); let size = { if !arrays_by_name.contains_key("size") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "size", )) @@ -217,7 +217,7 @@ impl crate::Loggable for TensorDimension { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt64, arrow_data.data_type().clone(), ) @@ -228,7 +228,7 @@ impl crate::Loggable for TensorDimension { }; let name = { if !arrays_by_name.contains_key("name") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "name", )) @@ -240,7 +240,7 @@ impl crate::Loggable for TensorDimension { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -257,10 +257,12 @@ impl crate::Loggable for TensorDimension { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -271,9 +273,11 @@ impl crate::Loggable for TensorDimension { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.TensorDimension#name")? .into_iter() } @@ -286,14 +290,14 @@ impl crate::Loggable for TensorDimension { opt.map(|(size, name)| { Ok(Self { size: size - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.TensorDimension#size")?, name, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.TensorDimension")? } }) diff --git a/crates/re_types/src/datatypes/transform3d.rs b/crates/re_types/src/datatypes/transform3d.rs index 3b58456e671f..087d37735ede 100644 --- a/crates/re_types/src/datatypes/transform3d.rs +++ b/crates/re_types/src/datatypes/transform3d.rs @@ -38,8 +38,8 @@ impl<'a> From<&'a Transform3D> for ::std::borrow::Cow<'a, Transform3D> { } } -impl crate::Loggable for Transform3D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Transform3D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -79,13 +79,13 @@ impl crate::Loggable for Transform3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -197,19 +197,19 @@ impl crate::Loggable for Transform3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { name : "_null_markers".to_owned(), data_type : @@ -237,14 +237,14 @@ impl crate::Loggable for Transform3D { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.datatypes.Transform3D")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -281,10 +281,12 @@ impl crate::Loggable for Transform3D { Ok(Some(match typ { 1i8 => Transform3D::TranslationAndMat3x3({ if offset as usize >= translation_and_mat3x3.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - translation_and_mat3x3.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + translation_and_mat3x3.len(), + ), + ) .with_context( "rerun.datatypes.Transform3D#TranslationAndMat3x3", ); @@ -293,17 +295,21 @@ impl crate::Loggable for Transform3D { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { translation_and_mat3x3.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.datatypes.Transform3D#TranslationAndMat3x3", )? }), 2i8 => Transform3D::TranslationRotationScale({ if offset as usize >= translation_rotation_scale.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - translation_rotation_scale.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + translation_rotation_scale.len(), + ), + ) .with_context( "rerun.datatypes.Transform3D#TranslationRotationScale", ); @@ -314,23 +320,25 @@ impl crate::Loggable for Transform3D { translation_rotation_scale.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.datatypes.Transform3D#TranslationRotationScale", )? }), _ => { - return Err(crate::DeserializationError::missing_union_arm( - Self::arrow_datatype(), - "", - *typ as _, - )) + return Err( + ::re_types_core::DeserializationError::missing_union_arm( + Self::arrow_datatype(), + "", + *typ as _, + ), + ) .with_context("rerun.datatypes.Transform3D"); } })) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.Transform3D")? } }) diff --git a/crates/re_types/src/datatypes/translation_and_mat3x3.rs b/crates/re_types/src/datatypes/translation_and_mat3x3.rs index 0a4c6285410e..26092eba025e 100644 --- a/crates/re_types/src/datatypes/translation_and_mat3x3.rs +++ b/crates/re_types/src/datatypes/translation_and_mat3x3.rs @@ -46,8 +46,8 @@ impl<'a> From<&'a TranslationAndMat3x3> for ::std::borrow::Cow<'a, TranslationAn } } -impl crate::Loggable for TranslationAndMat3x3 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for TranslationAndMat3x3 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -83,13 +83,13 @@ impl crate::Loggable for TranslationAndMat3x3 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -272,19 +272,19 @@ impl crate::Loggable for TranslationAndMat3x3 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "translation".to_owned(), @@ -321,7 +321,7 @@ impl crate::Loggable for TranslationAndMat3x3 { .collect(); let translation = { if !arrays_by_name.contains_key("translation") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "translation", )) @@ -333,7 +333,7 @@ impl crate::Loggable for TranslationAndMat3x3 { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -359,7 +359,7 @@ impl crate::Loggable for TranslationAndMat3x3 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -379,10 +379,12 @@ impl crate::Loggable for TranslationAndMat3x3 { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -400,14 +402,14 @@ impl crate::Loggable for TranslationAndMat3x3 { res_or_opt.map(|v| crate::datatypes::Vec3D(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let mat3x3 = { if !arrays_by_name.contains_key("mat3x3") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "mat3x3", )) @@ -419,7 +421,7 @@ impl crate::Loggable for TranslationAndMat3x3 { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -445,7 +447,7 @@ impl crate::Loggable for TranslationAndMat3x3 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -463,10 +465,12 @@ impl crate::Loggable for TranslationAndMat3x3 { elem.map(|(start, end)| { debug_assert!(end - start == 9usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -484,14 +488,14 @@ impl crate::Loggable for TranslationAndMat3x3 { res_or_opt.map(|v| crate::datatypes::Mat3x3(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let from_parent = { if !arrays_by_name.contains_key("from_parent") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "from_parent", )) @@ -502,7 +506,7 @@ impl crate::Loggable for TranslationAndMat3x3 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) @@ -520,13 +524,13 @@ impl crate::Loggable for TranslationAndMat3x3 { translation, mat3x3, from_parent: from_parent - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.datatypes.TranslationAndMat3x3#from_parent")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.TranslationAndMat3x3")? } }) diff --git a/crates/re_types/src/datatypes/translation_rotation_scale3d.rs b/crates/re_types/src/datatypes/translation_rotation_scale3d.rs index 9487ebb99fd8..a6b8a74abd4b 100644 --- a/crates/re_types/src/datatypes/translation_rotation_scale3d.rs +++ b/crates/re_types/src/datatypes/translation_rotation_scale3d.rs @@ -49,8 +49,8 @@ impl<'a> From<&'a TranslationRotationScale3D> } } -impl crate::Loggable for TranslationRotationScale3D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for TranslationRotationScale3D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -92,13 +92,13 @@ impl crate::Loggable for TranslationRotationScale3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -261,19 +261,19 @@ impl crate::Loggable for TranslationRotationScale3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "translation".to_owned(), @@ -316,7 +316,7 @@ impl crate::Loggable for TranslationRotationScale3D { .collect(); let translation = { if !arrays_by_name.contains_key("translation") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "translation", )) @@ -328,7 +328,7 @@ impl crate::Loggable for TranslationRotationScale3D { .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -350,23 +350,24 @@ impl crate::Loggable for TranslationRotationScale3D { let offsets = (0..) .step_by(3usize) .zip((3usize..).step_by(3usize).take(arrow_data.len())); - let arrow_data_inner = - { - let arrow_data_inner = &**arrow_data.values(); - arrow_data_inner + let arrow_data_inner = { + let arrow_data_inner = &**arrow_data.values(); + arrow_data_inner .as_any() .downcast_ref::() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( - DataType::Float32, - arrow_data_inner.data_type().clone(), - )) + .ok_or_else(|| { + ::re_types_core::DeserializationError::datatype_mismatch( + DataType::Float32, + arrow_data_inner.data_type().clone(), + ) + }) .with_context( "rerun.datatypes.TranslationRotationScale3D#translation", )? .into_iter() .map(|opt| opt.copied()) .collect::>() - }; + }; arrow2::bitmap::utils::ZipValidity::new_with_validity( offsets, arrow_data.validity(), @@ -375,10 +376,12 @@ impl crate::Loggable for TranslationRotationScale3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -396,14 +399,14 @@ impl crate::Loggable for TranslationRotationScale3D { res_or_opt.map(|v| crate::datatypes::Vec3D(v)) }) }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let rotation = { if !arrays_by_name.contains_key("rotation") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "rotation", )) @@ -416,7 +419,7 @@ impl crate::Loggable for TranslationRotationScale3D { }; let scale = { if !arrays_by_name.contains_key("scale") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "scale", )) @@ -429,7 +432,7 @@ impl crate::Loggable for TranslationRotationScale3D { }; let from_parent = { if !arrays_by_name.contains_key("from_parent") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "from_parent", )) @@ -440,7 +443,7 @@ impl crate::Loggable for TranslationRotationScale3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) @@ -459,7 +462,7 @@ impl crate::Loggable for TranslationRotationScale3D { rotation, scale, from_parent: from_parent - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.datatypes.TranslationRotationScale3D#from_parent", )?, @@ -467,7 +470,7 @@ impl crate::Loggable for TranslationRotationScale3D { }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.datatypes.TranslationRotationScale3D")? } }) diff --git a/crates/re_types/src/datatypes/utf8.rs b/crates/re_types/src/datatypes/utf8.rs index 78e87c8ded70..5ff18358af4d 100644 --- a/crates/re_types/src/datatypes/utf8.rs +++ b/crates/re_types/src/datatypes/utf8.rs @@ -17,16 +17,16 @@ /// **Datatype**: A string of text, encoded as UTF-8. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(transparent)] -pub struct Utf8(pub crate::ArrowString); +pub struct Utf8(pub ::re_types_core::ArrowString); -impl From for Utf8 { +impl From<::re_types_core::ArrowString> for Utf8 { #[inline] - fn from(value: crate::ArrowString) -> Self { + fn from(value: ::re_types_core::ArrowString) -> Self { Self(value) } } -impl From for crate::ArrowString { +impl From for ::re_types_core::ArrowString { #[inline] fn from(value: Utf8) -> Self { value.0 @@ -47,8 +47,8 @@ impl<'a> From<&'a Utf8> for ::std::borrow::Cow<'a, Utf8> { } } -impl crate::Loggable for Utf8 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Utf8 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -65,13 +65,13 @@ impl crate::Loggable for Utf8 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -116,19 +116,19 @@ impl crate::Loggable for Utf8 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -145,7 +145,7 @@ impl crate::Loggable for Utf8 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -158,15 +158,15 @@ impl crate::Loggable for Utf8 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString(v))) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Utf8#value")? .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Utf8#value") .with_context("rerun.datatypes.Utf8")?) } diff --git a/crates/re_types/src/datatypes/uvec2d.rs b/crates/re_types/src/datatypes/uvec2d.rs index 077f9d410feb..b8bb1ddb5ba1 100644 --- a/crates/re_types/src/datatypes/uvec2d.rs +++ b/crates/re_types/src/datatypes/uvec2d.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a UVec2D> for ::std::borrow::Cow<'a, UVec2D> { } } -impl crate::Loggable for UVec2D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for UVec2D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for UVec2D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -135,19 +135,19 @@ impl crate::Loggable for UVec2D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -173,7 +173,7 @@ impl crate::Loggable for UVec2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data_inner.data_type().clone(), ) @@ -191,7 +191,7 @@ impl crate::Loggable for UVec2D { elem.map(|(start, end)| { debug_assert!(end - start == 2usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -206,13 +206,13 @@ impl crate::Loggable for UVec2D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.UVec2D#xy") .with_context("rerun.datatypes.UVec2D")?) } diff --git a/crates/re_types/src/datatypes/uvec3d.rs b/crates/re_types/src/datatypes/uvec3d.rs index b67c8f29509c..fe6e21503c35 100644 --- a/crates/re_types/src/datatypes/uvec3d.rs +++ b/crates/re_types/src/datatypes/uvec3d.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a UVec3D> for ::std::borrow::Cow<'a, UVec3D> { } } -impl crate::Loggable for UVec3D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for UVec3D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for UVec3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -135,19 +135,19 @@ impl crate::Loggable for UVec3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -173,7 +173,7 @@ impl crate::Loggable for UVec3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data_inner.data_type().clone(), ) @@ -191,7 +191,7 @@ impl crate::Loggable for UVec3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -206,13 +206,13 @@ impl crate::Loggable for UVec3D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.UVec3D#xyz") .with_context("rerun.datatypes.UVec3D")?) } diff --git a/crates/re_types/src/datatypes/uvec4d.rs b/crates/re_types/src/datatypes/uvec4d.rs index 99b2b2cf7442..47053702f0fd 100644 --- a/crates/re_types/src/datatypes/uvec4d.rs +++ b/crates/re_types/src/datatypes/uvec4d.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a UVec4D> for ::std::borrow::Cow<'a, UVec4D> { } } -impl crate::Loggable for UVec4D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for UVec4D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for UVec4D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -135,19 +135,19 @@ impl crate::Loggable for UVec4D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -173,7 +173,7 @@ impl crate::Loggable for UVec4D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data_inner.data_type().clone(), ) @@ -191,7 +191,7 @@ impl crate::Loggable for UVec4D { elem.map(|(start, end)| { debug_assert!(end - start == 4usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -206,13 +206,13 @@ impl crate::Loggable for UVec4D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.UVec4D#xyzw") .with_context("rerun.datatypes.UVec4D")?) } diff --git a/crates/re_types/src/datatypes/vec2d.rs b/crates/re_types/src/datatypes/vec2d.rs index b9acd02781df..9886313e67fc 100644 --- a/crates/re_types/src/datatypes/vec2d.rs +++ b/crates/re_types/src/datatypes/vec2d.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a Vec2D> for ::std::borrow::Cow<'a, Vec2D> { } } -impl crate::Loggable for Vec2D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Vec2D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for Vec2D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -135,19 +135,19 @@ impl crate::Loggable for Vec2D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -173,7 +173,7 @@ impl crate::Loggable for Vec2D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -191,7 +191,7 @@ impl crate::Loggable for Vec2D { elem.map(|(start, end)| { debug_assert!(end - start == 2usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -206,13 +206,13 @@ impl crate::Loggable for Vec2D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Vec2D#xy") .with_context("rerun.datatypes.Vec2D")?) } diff --git a/crates/re_types/src/datatypes/vec3d.rs b/crates/re_types/src/datatypes/vec3d.rs index 22ad16bf6b3d..65215af189b6 100644 --- a/crates/re_types/src/datatypes/vec3d.rs +++ b/crates/re_types/src/datatypes/vec3d.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a Vec3D> for ::std::borrow::Cow<'a, Vec3D> { } } -impl crate::Loggable for Vec3D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Vec3D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for Vec3D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -135,19 +135,19 @@ impl crate::Loggable for Vec3D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -173,7 +173,7 @@ impl crate::Loggable for Vec3D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -191,7 +191,7 @@ impl crate::Loggable for Vec3D { elem.map(|(start, end)| { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -206,13 +206,13 @@ impl crate::Loggable for Vec3D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Vec3D#xyz") .with_context("rerun.datatypes.Vec3D")?) } diff --git a/crates/re_types/src/datatypes/vec4d.rs b/crates/re_types/src/datatypes/vec4d.rs index b13e08b361fd..50844b27c287 100644 --- a/crates/re_types/src/datatypes/vec4d.rs +++ b/crates/re_types/src/datatypes/vec4d.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a Vec4D> for ::std::borrow::Cow<'a, Vec4D> { } } -impl crate::Loggable for Vec4D { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for Vec4D { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -73,13 +73,13 @@ impl crate::Loggable for Vec4D { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -135,19 +135,19 @@ impl crate::Loggable for Vec4D { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -173,7 +173,7 @@ impl crate::Loggable for Vec4D { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -191,7 +191,7 @@ impl crate::Loggable for Vec4D { elem.map(|(start, end)| { debug_assert!(end - start == 4usize); if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -206,13 +206,13 @@ impl crate::Loggable for Vec4D { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.datatypes.Vec4D#xyzw") .with_context("rerun.datatypes.Vec4D")?) } diff --git a/crates/re_types/src/lib.rs b/crates/re_types/src/lib.rs index 2b825559be63..20266762c6b5 100644 --- a/crates/re_types/src/lib.rs +++ b/crates/re_types/src/lib.rs @@ -3,17 +3,6 @@ //! This crate contains both the IDL definitions for Rerun types (flatbuffers) as well as the code //! generated from those using `re_types_builder`. //! -//! The [`Archetype`] trait is the core of this crate and is a good starting point to get familiar -//! with the code. -//! An archetype is a logical collection of [`Component`]s that play well with each other. -//! -//! Rerun (and the underlying Arrow data framework) is designed to work with large arrays of -//! [`Component`]s, as opposed to single instances. -//! When multiple instances of a [`Component`] are put together in an array, they yield a -//! [`ComponentBatch`]: the atomic unit of (de)serialization. -//! -//! Internally, [`Component`]s are implemented using many different [`Datatype`]s. -//! //! All builtin archetypes, components and datatypes can be found in their respective top-level //! modules. //! @@ -184,76 +173,6 @@ // --- -/// Describes the interface for interpreting an object as a bundle of [`Component`]s. -/// -/// ## Custom bundles -/// -/// While, in most cases, component bundles are code generated from our [IDL definitions], -/// it is possible to manually extend existing bundles, or even implement fully custom ones. -/// -/// All [`AsComponents`] methods are optional to implement, with the exception of -/// [`AsComponents::as_component_batches`], which describes how the bundle can be interpreted -/// as a set of [`ComponentBatch`]es: arrays of components that are ready to be serialized. -/// -/// Have a look at our [Custom Data] example to learn more about handwritten bundles. -/// -/// [IDL definitions]: https://github.com/rerun-io/rerun/tree/latest/crates/re_types/definitions/rerun -/// [Custom Data]: https://github.com/rerun-io/rerun/blob/latest/examples/rust/custom_data/src/main.rs -pub trait AsComponents { - /// Exposes the object's contents as a set of [`ComponentBatch`]s. - /// - /// This is the main mechanism for easily extending builtin archetypes or even writing - /// fully custom ones. - /// Have a look at our [Custom Data] example to learn more about extending archetypes. - /// - /// [Custom Data]: https://github.com/rerun-io/rerun/blob/latest/examples/rust/custom_data/src/main.rs - // - // NOTE: Don't bother returning a CoW here: we need to dynamically discard optional components - // depending on their presence (or lack thereof) at runtime anyway. - fn as_component_batches(&self) -> Vec>; - - /// The number of instances in each batch. - /// - /// If not implemented, the number of instances will be determined by the longest - /// batch in the bundle. - /// - /// Each batch returned by `as_component_batches` should have this number of elements, - /// or 1 in the case it is a splat, or 0 in the case that component is being cleared. - #[inline] - fn num_instances(&self) -> usize { - self.as_component_batches() - .into_iter() - .map(|comp_batch| comp_batch.as_ref().num_instances()) - .max() - .unwrap_or(0) - } - - // --- - - /// Serializes all non-null [`Component`]s of this bundle into Arrow arrays. - /// - /// The default implementation will simply serialize the result of [`Self::as_component_batches`] - /// as-is, which is what you want in 99.9% of cases. - #[inline] - fn to_arrow( - &self, - ) -> SerializationResult)>> - { - self.as_component_batches() - .into_iter() - .map(|comp_batch| { - comp_batch - .as_ref() - .to_arrow() - .map(|array| (comp_batch.as_ref().arrow_field(), array)) - .with_context(comp_batch.as_ref().name()) - }) - .collect() - } -} - -// --- - /// Number of decimals shown for all vector display methods. pub const DISPLAY_PRECISION: usize = 3; @@ -294,38 +213,22 @@ pub mod datatypes; /// Unstable. Used for the ongoing blueprint experimentations. pub mod blueprint; -mod archetype; -mod loggable; -mod loggable_batch; -mod result; -mod size_bytes; - -pub use self::archetype::{ - Archetype, ArchetypeName, GenericIndicatorComponent, NamedIndicatorComponent, -}; -pub use self::loggable::{ - Component, ComponentName, ComponentNameSet, Datatype, DatatypeName, Loggable, -}; -pub use self::loggable_batch::{ - ComponentBatch, DatatypeBatch, LoggableBatch, MaybeOwnedComponentBatch, -}; -pub use self::result::{ - DeserializationError, DeserializationResult, ResultExt, SerializationError, - SerializationResult, _Backtrace, -}; -pub use self::size_bytes::SizeBytes; - #[cfg(feature = "datagen")] pub mod datagen; // --- -mod arrow_buffer; -mod arrow_string; -pub use self::arrow_buffer::ArrowBuffer; -pub use self::arrow_string::ArrowString; +// One almost never uses `re_types` without `re_types_core`, so we reexport these core types +// for convenience. +// The opposite is not true, though: make sure you're not depending on `re_types` if all you need +// in `re_types_core` in order to prevent some nasty dep cycles! +pub use re_types_core::*; + +// --- pub mod external { + pub use re_types_core; + pub use anyhow; pub use arrow2; pub use uuid; diff --git a/crates/re_types/src/tensor_data.rs b/crates/re_types/src/tensor_data.rs index fd0e9e114943..8d049ecee3b6 100644 --- a/crates/re_types/src/tensor_data.rs +++ b/crates/re_types/src/tensor_data.rs @@ -547,7 +547,7 @@ impl DecodedTensor { } pub fn decode_jpeg_bytes( - jpeg_bytes: &crate::ArrowBuffer, + jpeg_bytes: &::re_types_core::ArrowBuffer, [expected_height, expected_width, expected_channels]: [u64; 3], ) -> Result { re_tracing::profile_function!(); diff --git a/crates/re_types/src/testing/archetypes/affix_fuzzer1.rs b/crates/re_types/src/testing/archetypes/affix_fuzzer1.rs index 7c83dfac37d1..c92ef04d8494 100644 --- a/crates/re_types/src/testing/archetypes/affix_fuzzer1.rs +++ b/crates/re_types/src/testing/archetypes/affix_fuzzer1.rs @@ -39,7 +39,7 @@ pub struct AffixFuzzer1 { pub fuzz1021: crate::testing::components::AffixFuzzer21, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 21usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 21usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.testing.components.AffixFuzzer1".into(), @@ -66,13 +66,13 @@ static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 21usize ] }); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.testing.components.AffixFuzzer1Indicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 23usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 23usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.testing.components.AffixFuzzer1".into(), @@ -105,40 +105,40 @@ impl AffixFuzzer1 { pub const NUM_COMPONENTS: usize = 23usize; } -/// Indicator component for the [`AffixFuzzer1`] [`crate::Archetype`] -pub type AffixFuzzer1Indicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`AffixFuzzer1`] [`::re_types_core::Archetype`] +pub type AffixFuzzer1Indicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for AffixFuzzer1 { +impl ::re_types_core::Archetype for AffixFuzzer1 { type Indicator = AffixFuzzer1Indicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.testing.archetypes.AffixFuzzer1".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: AffixFuzzer1Indicator = AffixFuzzer1Indicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -147,9 +147,9 @@ impl crate::Archetype for AffixFuzzer1 { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -157,274 +157,274 @@ impl crate::Archetype for AffixFuzzer1 { let fuzz1001 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer1") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1001")? }; let fuzz1002 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer2") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1002")? }; let fuzz1003 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer3") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1003")? }; let fuzz1004 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer4") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1004")? }; let fuzz1005 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer5") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1005")? }; let fuzz1006 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer6") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1006")? }; let fuzz1007 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer7") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1007")? }; let fuzz1008 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer8") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1008")? }; let fuzz1009 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer9") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1009")? }; let fuzz1010 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer10") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1010")? }; let fuzz1011 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer11") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1011")? }; let fuzz1012 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer12") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1012")? }; let fuzz1013 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer13") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1013")? }; let fuzz1014 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer14") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1014")? }; let fuzz1015 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer15") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1015")? }; let fuzz1016 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer16") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1016")? }; let fuzz1017 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer17") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1017")? }; let fuzz1018 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer18") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1018")? }; let fuzz1019 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer19") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1019")? }; let fuzz1020 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer20") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1020")? }; let fuzz1021 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer21") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")? .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer1#fuzz1021")? }; Ok(Self { @@ -453,33 +453,33 @@ impl crate::Archetype for AffixFuzzer1 { } } -impl crate::AsComponents for AffixFuzzer1 { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for AffixFuzzer1 { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.fuzz1001 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1002 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1003 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1004 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1005 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1006 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1007 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1008 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1009 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1010 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1011 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1012 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1013 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1014 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1015 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1016 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1017 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1018 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1019 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1020 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1021 as &dyn crate::ComponentBatch).into()), + Some((&self.fuzz1001 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1002 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1003 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1004 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1005 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1006 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1007 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1008 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1009 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1010 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1011 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1012 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1013 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1014 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1015 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1016 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1017 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1018 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1019 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1020 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1021 as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/testing/archetypes/affix_fuzzer2.rs b/crates/re_types/src/testing/archetypes/affix_fuzzer2.rs index f7c19cfccdb8..234ae528cc7f 100644 --- a/crates/re_types/src/testing/archetypes/affix_fuzzer2.rs +++ b/crates/re_types/src/testing/archetypes/affix_fuzzer2.rs @@ -36,7 +36,7 @@ pub struct AffixFuzzer2 { pub fuzz1118: Vec, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 18usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 18usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.testing.components.AffixFuzzer1".into(), @@ -60,13 +60,13 @@ static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 18usize ] }); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.testing.components.AffixFuzzer2Indicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.components.InstanceKey".into()]); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 20usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 20usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.testing.components.AffixFuzzer1".into(), @@ -96,40 +96,40 @@ impl AffixFuzzer2 { pub const NUM_COMPONENTS: usize = 20usize; } -/// Indicator component for the [`AffixFuzzer2`] [`crate::Archetype`] -pub type AffixFuzzer2Indicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`AffixFuzzer2`] [`::re_types_core::Archetype`] +pub type AffixFuzzer2Indicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for AffixFuzzer2 { +impl ::re_types_core::Archetype for AffixFuzzer2 { type Indicator = AffixFuzzer2Indicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.testing.archetypes.AffixFuzzer2".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: AffixFuzzer2Indicator = AffixFuzzer2Indicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -138,9 +138,9 @@ impl crate::Archetype for AffixFuzzer2 { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -148,217 +148,217 @@ impl crate::Archetype for AffixFuzzer2 { let fuzz1101 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer1") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1101")? }; let fuzz1102 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer2") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1102")? }; let fuzz1103 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer3") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1103")? }; let fuzz1104 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer4") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1104")? }; let fuzz1105 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer5") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1105")? }; let fuzz1106 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer6") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1106")? }; let fuzz1107 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer7") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1107")? }; let fuzz1108 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer8") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1108")? }; let fuzz1109 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer9") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1109")? }; let fuzz1110 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer10") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1110")? }; let fuzz1111 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer11") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1111")? }; let fuzz1112 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer12") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1112")? }; let fuzz1113 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer13") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1113")? }; let fuzz1114 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer14") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1114")? }; let fuzz1115 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer15") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1115")? }; let fuzz1116 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer16") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1116")? }; let fuzz1117 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer17") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1117")? }; let fuzz1118 = { let array = arrays_by_name .get("rerun.testing.components.AffixFuzzer18") - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")?; ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer2#fuzz1118")? }; Ok(Self { @@ -384,30 +384,30 @@ impl crate::Archetype for AffixFuzzer2 { } } -impl crate::AsComponents for AffixFuzzer2 { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for AffixFuzzer2 { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), - Some((&self.fuzz1101 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1102 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1103 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1104 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1105 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1106 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1107 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1108 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1109 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1110 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1111 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1112 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1113 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1114 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1115 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1116 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1117 as &dyn crate::ComponentBatch).into()), - Some((&self.fuzz1118 as &dyn crate::ComponentBatch).into()), + Some((&self.fuzz1101 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1102 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1103 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1104 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1105 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1106 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1107 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1108 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1109 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1110 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1111 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1112 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1113 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1114 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1115 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1116 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1117 as &dyn ::re_types_core::ComponentBatch).into()), + Some((&self.fuzz1118 as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/testing/archetypes/affix_fuzzer3.rs b/crates/re_types/src/testing/archetypes/affix_fuzzer3.rs index b1fdf2defd0b..917efa6996ef 100644 --- a/crates/re_types/src/testing/archetypes/affix_fuzzer3.rs +++ b/crates/re_types/src/testing/archetypes/affix_fuzzer3.rs @@ -36,13 +36,13 @@ pub struct AffixFuzzer3 { pub fuzz2018: Option, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 0usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 0usize]> = once_cell::sync::Lazy::new(|| []); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.testing.components.AffixFuzzer3Indicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 19usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 19usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.InstanceKey".into(), @@ -67,7 +67,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 19usize ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 20usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 20usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.testing.components.AffixFuzzer3Indicator".into(), @@ -97,40 +97,40 @@ impl AffixFuzzer3 { pub const NUM_COMPONENTS: usize = 20usize; } -/// Indicator component for the [`AffixFuzzer3`] [`crate::Archetype`] -pub type AffixFuzzer3Indicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`AffixFuzzer3`] [`::re_types_core::Archetype`] +pub type AffixFuzzer3Indicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for AffixFuzzer3 { +impl ::re_types_core::Archetype for AffixFuzzer3 { type Indicator = AffixFuzzer3Indicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.testing.archetypes.AffixFuzzer3".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: AffixFuzzer3Indicator = AffixFuzzer3Indicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -139,9 +139,9 @@ impl crate::Archetype for AffixFuzzer3 { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -154,7 +154,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2001")? }) } else { @@ -168,7 +168,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2002")? }) } else { @@ -182,7 +182,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2003")? }) } else { @@ -196,7 +196,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2004")? }) } else { @@ -210,7 +210,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2005")? }) } else { @@ -224,7 +224,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2006")? }) } else { @@ -238,7 +238,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2007")? }) } else { @@ -252,7 +252,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2008")? }) } else { @@ -266,7 +266,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2009")? }) } else { @@ -280,7 +280,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2010")? }) } else { @@ -294,7 +294,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2011")? }) } else { @@ -308,7 +308,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2012")? }) } else { @@ -322,7 +322,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2013")? }) } else { @@ -336,7 +336,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2014")? }) } else { @@ -350,7 +350,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2015")? }) } else { @@ -364,7 +364,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2016")? }) } else { @@ -378,7 +378,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2017")? }) } else { @@ -392,7 +392,7 @@ impl crate::Archetype for AffixFuzzer3 { .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.archetypes.AffixFuzzer3#fuzz2018")? }) } else { @@ -421,66 +421,66 @@ impl crate::Archetype for AffixFuzzer3 { } } -impl crate::AsComponents for AffixFuzzer3 { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for AffixFuzzer3 { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), self.fuzz2001 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2002 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2003 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2004 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2005 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2006 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2007 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2008 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2009 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2010 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2011 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2012 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2013 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2014 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2015 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2016 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2017 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2018 .as_ref() - .map(|comp| (comp as &dyn crate::ComponentBatch).into()), + .map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/testing/archetypes/affix_fuzzer4.rs b/crates/re_types/src/testing/archetypes/affix_fuzzer4.rs index 617b8dfe4dfc..681e5d5c91c6 100644 --- a/crates/re_types/src/testing/archetypes/affix_fuzzer4.rs +++ b/crates/re_types/src/testing/archetypes/affix_fuzzer4.rs @@ -36,13 +36,13 @@ pub struct AffixFuzzer4 { pub fuzz2118: Option>, } -static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 0usize]> = +static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 0usize]> = once_cell::sync::Lazy::new(|| []); -static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 1usize]> = +static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 1usize]> = once_cell::sync::Lazy::new(|| ["rerun.testing.components.AffixFuzzer4Indicator".into()]); -static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 19usize]> = +static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 19usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.components.InstanceKey".into(), @@ -67,7 +67,7 @@ static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 19usize ] }); -static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; 20usize]> = +static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; 20usize]> = once_cell::sync::Lazy::new(|| { [ "rerun.testing.components.AffixFuzzer4Indicator".into(), @@ -97,40 +97,40 @@ impl AffixFuzzer4 { pub const NUM_COMPONENTS: usize = 20usize; } -/// Indicator component for the [`AffixFuzzer4`] [`crate::Archetype`] -pub type AffixFuzzer4Indicator = crate::GenericIndicatorComponent; +/// Indicator component for the [`AffixFuzzer4`] [`::re_types_core::Archetype`] +pub type AffixFuzzer4Indicator = ::re_types_core::GenericIndicatorComponent; -impl crate::Archetype for AffixFuzzer4 { +impl ::re_types_core::Archetype for AffixFuzzer4 { type Indicator = AffixFuzzer4Indicator; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { "rerun.testing.archetypes.AffixFuzzer4".into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: AffixFuzzer4Indicator = AffixFuzzer4Indicator::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } @@ -139,9 +139,9 @@ impl crate::Archetype for AffixFuzzer4 { arrow_data: impl IntoIterator< Item = (::arrow2::datatypes::Field, Box), >, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() .map(|(field, array)| (field.name, array)) @@ -152,8 +152,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2101")? }) } else { @@ -165,8 +165,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2102")? }) } else { @@ -178,8 +178,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2103")? }) } else { @@ -191,8 +191,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2104")? }) } else { @@ -204,8 +204,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2105")? }) } else { @@ -217,8 +217,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2106")? }) } else { @@ -230,8 +230,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2107")? }) } else { @@ -243,8 +243,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2108")? }) } else { @@ -256,8 +256,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2109")? }) } else { @@ -269,8 +269,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2110")? }) } else { @@ -282,8 +282,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2111")? }) } else { @@ -295,8 +295,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2112")? }) } else { @@ -308,8 +308,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2113")? }) } else { @@ -321,8 +321,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2114")? }) } else { @@ -334,8 +334,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2115")? }) } else { @@ -347,8 +347,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2116")? }) } else { @@ -360,8 +360,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2117")? }) } else { @@ -373,8 +373,8 @@ impl crate::Archetype for AffixFuzzer4 { ::from_arrow_opt(&**array) .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.archetypes.AffixFuzzer4#fuzz2118")? }) } else { @@ -403,66 +403,66 @@ impl crate::Archetype for AffixFuzzer4 { } } -impl crate::AsComponents for AffixFuzzer4 { - fn as_component_batches(&self) -> Vec> { +impl ::re_types_core::AsComponents for AffixFuzzer4 { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [ Some(Self::indicator()), self.fuzz2101 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2102 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2103 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2104 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2105 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2106 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2107 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2108 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2109 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2110 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2111 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2112 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2113 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2114 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2115 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2116 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2117 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), self.fuzz2118 .as_ref() - .map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()), + .map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()), ] .into_iter() .flatten() diff --git a/crates/re_types/src/testing/components/affix_fuzzer1.rs b/crates/re_types/src/testing/components/affix_fuzzer1.rs index f3e43bb0a395..d87d993bbf6d 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer1.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer1.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer1> for ::std::borrow::Cow<'a, AffixFuzzer1> { } } -impl crate::Loggable for AffixFuzzer1 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer1 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -141,13 +141,13 @@ impl crate::Loggable for AffixFuzzer1 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -174,20 +174,20 @@ impl crate::Loggable for AffixFuzzer1 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer1#single_required")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer1#single_required") .with_context("rerun.testing.components.AffixFuzzer1")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer10.rs b/crates/re_types/src/testing/components/affix_fuzzer10.rs index 70fe7d235f2e..fdf18d086d07 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer10.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer10.rs @@ -15,16 +15,16 @@ #![allow(clippy::unnecessary_cast)] #[derive(Clone, Debug, Default, PartialEq, Eq)] -pub struct AffixFuzzer10(pub Option); +pub struct AffixFuzzer10(pub Option<::re_types_core::ArrowString>); -impl From> for AffixFuzzer10 { +impl From> for AffixFuzzer10 { #[inline] - fn from(single_string_optional: Option) -> Self { + fn from(single_string_optional: Option<::re_types_core::ArrowString>) -> Self { Self(single_string_optional) } } -impl From for Option { +impl From for Option<::re_types_core::ArrowString> { #[inline] fn from(value: AffixFuzzer10) -> Self { value.0 @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer10> for ::std::borrow::Cow<'a, AffixFuzzer10> { } } -impl crate::Loggable for AffixFuzzer10 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer10 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -63,13 +63,13 @@ impl crate::Loggable for AffixFuzzer10 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -116,19 +116,19 @@ impl crate::Loggable for AffixFuzzer10 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -145,7 +145,7 @@ impl crate::Loggable for AffixFuzzer10 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -158,15 +158,15 @@ impl crate::Loggable for AffixFuzzer10 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString(v))) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer10#single_string_optional")? .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer10#single_string_optional") .with_context("rerun.testing.components.AffixFuzzer10")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer11.rs b/crates/re_types/src/testing/components/affix_fuzzer11.rs index 96dd8f73b668..a97a268fd30a 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer11.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer11.rs @@ -15,16 +15,16 @@ #![allow(clippy::unnecessary_cast)] #[derive(Clone, Debug, Default, PartialEq)] -pub struct AffixFuzzer11(pub Option>); +pub struct AffixFuzzer11(pub Option<::re_types_core::ArrowBuffer>); -impl From>> for AffixFuzzer11 { +impl From>> for AffixFuzzer11 { #[inline] - fn from(many_floats_optional: Option>) -> Self { + fn from(many_floats_optional: Option<::re_types_core::ArrowBuffer>) -> Self { Self(many_floats_optional) } } -impl From for Option> { +impl From for Option<::re_types_core::ArrowBuffer> { #[inline] fn from(value: AffixFuzzer11) -> Self { value.0 @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer11> for ::std::borrow::Cow<'a, AffixFuzzer11> { } } -impl crate::Loggable for AffixFuzzer11 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer11 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -68,13 +68,13 @@ impl crate::Loggable for AffixFuzzer11 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -126,19 +126,19 @@ impl crate::Loggable for AffixFuzzer11 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, @@ -158,7 +158,7 @@ impl crate::Loggable for AffixFuzzer11 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), ) @@ -178,7 +178,7 @@ impl crate::Loggable for AffixFuzzer11 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -190,18 +190,18 @@ impl crate::Loggable for AffixFuzzer11 { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer11#many_floats_optional") .with_context("rerun.testing.components.AffixFuzzer11")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer12.rs b/crates/re_types/src/testing/components/affix_fuzzer12.rs index 812dfc0c5a78..53001151c6f6 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer12.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer12.rs @@ -15,16 +15,16 @@ #![allow(clippy::unnecessary_cast)] #[derive(Clone, Debug, Default, PartialEq, Eq)] -pub struct AffixFuzzer12(pub Vec); +pub struct AffixFuzzer12(pub Vec<::re_types_core::ArrowString>); -impl From> for AffixFuzzer12 { +impl From> for AffixFuzzer12 { #[inline] - fn from(many_strings_required: Vec) -> Self { + fn from(many_strings_required: Vec<::re_types_core::ArrowString>) -> Self { Self(many_strings_required) } } -impl From for Vec { +impl From for Vec<::re_types_core::ArrowString> { #[inline] fn from(value: AffixFuzzer12) -> Self { value.0 @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer12> for ::std::borrow::Cow<'a, AffixFuzzer12> { } } -impl crate::Loggable for AffixFuzzer12 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer12 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -68,13 +68,13 @@ impl crate::Loggable for AffixFuzzer12 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -146,19 +146,19 @@ impl crate::Loggable for AffixFuzzer12 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, @@ -179,7 +179,7 @@ impl crate::Loggable for AffixFuzzer12 { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data_inner.data_type().clone(), ) @@ -198,10 +198,12 @@ impl crate::Loggable for AffixFuzzer12 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -213,9 +215,11 @@ impl crate::Loggable for AffixFuzzer12 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context( "rerun.testing.components.AffixFuzzer12#many_strings_required", )? @@ -233,7 +237,7 @@ impl crate::Loggable for AffixFuzzer12 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -251,13 +255,13 @@ impl crate::Loggable for AffixFuzzer12 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer12#many_strings_required") .with_context("rerun.testing.components.AffixFuzzer12")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer13.rs b/crates/re_types/src/testing/components/affix_fuzzer13.rs index a0caf4a3bac3..a8bcef468cc6 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer13.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer13.rs @@ -15,16 +15,16 @@ #![allow(clippy::unnecessary_cast)] #[derive(Clone, Debug, Default, PartialEq, Eq)] -pub struct AffixFuzzer13(pub Option>); +pub struct AffixFuzzer13(pub Option>); -impl From>> for AffixFuzzer13 { +impl From>> for AffixFuzzer13 { #[inline] - fn from(many_strings_optional: Option>) -> Self { + fn from(many_strings_optional: Option>) -> Self { Self(many_strings_optional) } } -impl From for Option> { +impl From for Option> { #[inline] fn from(value: AffixFuzzer13) -> Self { value.0 @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer13> for ::std::borrow::Cow<'a, AffixFuzzer13> { } } -impl crate::Loggable for AffixFuzzer13 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer13 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -68,13 +68,13 @@ impl crate::Loggable for AffixFuzzer13 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -148,19 +148,19 @@ impl crate::Loggable for AffixFuzzer13 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, @@ -181,7 +181,7 @@ impl crate::Loggable for AffixFuzzer13 { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data_inner.data_type().clone(), ) @@ -200,10 +200,12 @@ impl crate::Loggable for AffixFuzzer13 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -215,9 +217,11 @@ impl crate::Loggable for AffixFuzzer13 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context( "rerun.testing.components.AffixFuzzer13#many_strings_optional", )? @@ -235,7 +239,7 @@ impl crate::Loggable for AffixFuzzer13 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -253,13 +257,13 @@ impl crate::Loggable for AffixFuzzer13 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer13#many_strings_optional") .with_context("rerun.testing.components.AffixFuzzer13")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer14.rs b/crates/re_types/src/testing/components/affix_fuzzer14.rs index 223776bec0ca..acb3338af6a6 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer14.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer14.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer14> for ::std::borrow::Cow<'a, AffixFuzzer14> { } } -impl crate::Loggable for AffixFuzzer14 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer14 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -119,13 +119,13 @@ impl crate::Loggable for AffixFuzzer14 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -152,20 +152,20 @@ impl crate::Loggable for AffixFuzzer14 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer14#single_required_union")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer14#single_required_union") .with_context("rerun.testing.components.AffixFuzzer14")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer15.rs b/crates/re_types/src/testing/components/affix_fuzzer15.rs index df08a8349bad..cbe77243302f 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer15.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer15.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer15> for ::std::borrow::Cow<'a, AffixFuzzer15> { } } -impl crate::Loggable for AffixFuzzer15 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer15 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -119,13 +119,13 @@ impl crate::Loggable for AffixFuzzer15 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -154,20 +154,20 @@ impl crate::Loggable for AffixFuzzer15 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer3::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer15#single_optional_union")? .into_iter() .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer15#single_optional_union") .with_context("rerun.testing.components.AffixFuzzer15")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer16.rs b/crates/re_types/src/testing/components/affix_fuzzer16.rs index da1907b14e58..7c0c26e911f7 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer16.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer16.rs @@ -39,8 +39,8 @@ impl<'a> From<&'a AffixFuzzer16> for ::std::borrow::Cow<'a, AffixFuzzer16> { } } -impl crate::Loggable for AffixFuzzer16 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer16 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -62,13 +62,13 @@ impl crate::Loggable for AffixFuzzer16 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -119,19 +119,19 @@ impl crate::Loggable for AffixFuzzer16 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -164,7 +164,7 @@ impl crate::Loggable for AffixFuzzer16 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -182,13 +182,13 @@ impl crate::Loggable for AffixFuzzer16 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer16#many_required_unions") .with_context("rerun.testing.components.AffixFuzzer16")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer17.rs b/crates/re_types/src/testing/components/affix_fuzzer17.rs index 89f1e5c11ba0..2c3ff60b991c 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer17.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer17.rs @@ -39,8 +39,8 @@ impl<'a> From<&'a AffixFuzzer17> for ::std::borrow::Cow<'a, AffixFuzzer17> { } } -impl crate::Loggable for AffixFuzzer17 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer17 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -62,13 +62,13 @@ impl crate::Loggable for AffixFuzzer17 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -121,19 +121,19 @@ impl crate::Loggable for AffixFuzzer17 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -166,7 +166,7 @@ impl crate::Loggable for AffixFuzzer17 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -184,13 +184,13 @@ impl crate::Loggable for AffixFuzzer17 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer17#many_optional_unions") .with_context("rerun.testing.components.AffixFuzzer17")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer18.rs b/crates/re_types/src/testing/components/affix_fuzzer18.rs index 85744e7d80df..c680a8ee006d 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer18.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer18.rs @@ -39,8 +39,8 @@ impl<'a> From<&'a AffixFuzzer18> for ::std::borrow::Cow<'a, AffixFuzzer18> { } } -impl crate::Loggable for AffixFuzzer18 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer18 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -62,13 +62,13 @@ impl crate::Loggable for AffixFuzzer18 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -121,19 +121,19 @@ impl crate::Loggable for AffixFuzzer18 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -166,7 +166,7 @@ impl crate::Loggable for AffixFuzzer18 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -184,13 +184,13 @@ impl crate::Loggable for AffixFuzzer18 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer18#many_optional_unions") .with_context("rerun.testing.components.AffixFuzzer18")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer19.rs b/crates/re_types/src/testing/components/affix_fuzzer19.rs index e7e072ede7d2..af8eb9f2b7b7 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer19.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer19.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer19> for ::std::borrow::Cow<'a, AffixFuzzer19> { } } -impl crate::Loggable for AffixFuzzer19 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer19 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -76,13 +76,13 @@ impl crate::Loggable for AffixFuzzer19 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -109,20 +109,20 @@ impl crate::Loggable for AffixFuzzer19 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer5::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer19#just_a_table_nothing_shady")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer19#just_a_table_nothing_shady") .with_context("rerun.testing.components.AffixFuzzer19")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer2.rs b/crates/re_types/src/testing/components/affix_fuzzer2.rs index 31047d321296..c24981bd55ee 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer2.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer2.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer2> for ::std::borrow::Cow<'a, AffixFuzzer2> { } } -impl crate::Loggable for AffixFuzzer2 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer2 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -141,13 +141,13 @@ impl crate::Loggable for AffixFuzzer2 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -174,20 +174,20 @@ impl crate::Loggable for AffixFuzzer2 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer2#single_required")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer2#single_required") .with_context("rerun.testing.components.AffixFuzzer2")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer20.rs b/crates/re_types/src/testing/components/affix_fuzzer20.rs index 20d66978d8cf..4488e14afa1e 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer20.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer20.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer20> for ::std::borrow::Cow<'a, AffixFuzzer20> { } } -impl crate::Loggable for AffixFuzzer20 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer20 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -84,13 +84,13 @@ impl crate::Loggable for AffixFuzzer20 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -117,20 +117,20 @@ impl crate::Loggable for AffixFuzzer20 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer20::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer20#nested_transparent")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer20#nested_transparent") .with_context("rerun.testing.components.AffixFuzzer20")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer21.rs b/crates/re_types/src/testing/components/affix_fuzzer21.rs index 21436d6ad642..588969e86765 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer21.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer21.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer21> for ::std::borrow::Cow<'a, AffixFuzzer21> { } } -impl crate::Loggable for AffixFuzzer21 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer21 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -89,13 +89,13 @@ impl crate::Loggable for AffixFuzzer21 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -122,20 +122,20 @@ impl crate::Loggable for AffixFuzzer21 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer21::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer21#nested_halves")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer21#nested_halves") .with_context("rerun.testing.components.AffixFuzzer21")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer3.rs b/crates/re_types/src/testing/components/affix_fuzzer3.rs index 2034b8a1f6d5..b0db347185f2 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer3.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer3.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer3> for ::std::borrow::Cow<'a, AffixFuzzer3> { } } -impl crate::Loggable for AffixFuzzer3 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer3 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -141,13 +141,13 @@ impl crate::Loggable for AffixFuzzer3 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -174,20 +174,20 @@ impl crate::Loggable for AffixFuzzer3 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer3#single_required")? .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer3#single_required") .with_context("rerun.testing.components.AffixFuzzer3")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer4.rs b/crates/re_types/src/testing/components/affix_fuzzer4.rs index 3c1c94d41abb..3cc131cf4dcb 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer4.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer4.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer4> for ::std::borrow::Cow<'a, AffixFuzzer4> { } } -impl crate::Loggable for AffixFuzzer4 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer4 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -141,13 +141,13 @@ impl crate::Loggable for AffixFuzzer4 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -176,20 +176,20 @@ impl crate::Loggable for AffixFuzzer4 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer4#single_optional")? .into_iter() .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer4#single_optional") .with_context("rerun.testing.components.AffixFuzzer4")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer5.rs b/crates/re_types/src/testing/components/affix_fuzzer5.rs index cf4645f0adee..b8df770a70e6 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer5.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer5.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer5> for ::std::borrow::Cow<'a, AffixFuzzer5> { } } -impl crate::Loggable for AffixFuzzer5 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer5 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -141,13 +141,13 @@ impl crate::Loggable for AffixFuzzer5 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -176,20 +176,20 @@ impl crate::Loggable for AffixFuzzer5 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer5#single_optional")? .into_iter() .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer5#single_optional") .with_context("rerun.testing.components.AffixFuzzer5")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer6.rs b/crates/re_types/src/testing/components/affix_fuzzer6.rs index 841bc8c9ad60..995bdbd06f1d 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer6.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer6.rs @@ -53,8 +53,8 @@ impl<'a> From<&'a AffixFuzzer6> for ::std::borrow::Cow<'a, AffixFuzzer6> { } } -impl crate::Loggable for AffixFuzzer6 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer6 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -141,13 +141,13 @@ impl crate::Loggable for AffixFuzzer6 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -176,20 +176,20 @@ impl crate::Loggable for AffixFuzzer6 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok( crate::testing::datatypes::AffixFuzzer1::from_arrow_opt(arrow_data) .with_context("rerun.testing.components.AffixFuzzer6#single_optional")? .into_iter() .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer6#single_optional") .with_context("rerun.testing.components.AffixFuzzer6")?, ) diff --git a/crates/re_types/src/testing/components/affix_fuzzer7.rs b/crates/re_types/src/testing/components/affix_fuzzer7.rs index 53072210faca..9ea51b06c80f 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer7.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer7.rs @@ -39,8 +39,8 @@ impl<'a> From<&'a AffixFuzzer7> for ::std::borrow::Cow<'a, AffixFuzzer7> { } } -impl crate::Loggable for AffixFuzzer7 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer7 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -62,13 +62,13 @@ impl crate::Loggable for AffixFuzzer7 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -121,19 +121,19 @@ impl crate::Loggable for AffixFuzzer7 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: ::arrow_datatype(), @@ -164,7 +164,7 @@ impl crate::Loggable for AffixFuzzer7 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), )); @@ -182,13 +182,13 @@ impl crate::Loggable for AffixFuzzer7 { }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer7#many_optional") .with_context("rerun.testing.components.AffixFuzzer7")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer8.rs b/crates/re_types/src/testing/components/affix_fuzzer8.rs index b1ae4989c99e..418eb2a40208 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer8.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer8.rs @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer8> for ::std::borrow::Cow<'a, AffixFuzzer8> { } } -impl crate::Loggable for AffixFuzzer8 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer8 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -63,13 +63,13 @@ impl crate::Loggable for AffixFuzzer8 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -100,18 +100,18 @@ impl crate::Loggable for AffixFuzzer8 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -121,7 +121,7 @@ impl crate::Loggable for AffixFuzzer8 { .map(|opt| opt.copied()) .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer8#single_float_optional") .with_context("rerun.testing.components.AffixFuzzer8")?) } diff --git a/crates/re_types/src/testing/components/affix_fuzzer9.rs b/crates/re_types/src/testing/components/affix_fuzzer9.rs index 9cd82228d4c6..cedb31089b48 100644 --- a/crates/re_types/src/testing/components/affix_fuzzer9.rs +++ b/crates/re_types/src/testing/components/affix_fuzzer9.rs @@ -15,16 +15,16 @@ #![allow(clippy::unnecessary_cast)] #[derive(Clone, Debug, Default, PartialEq, Eq)] -pub struct AffixFuzzer9(pub crate::ArrowString); +pub struct AffixFuzzer9(pub ::re_types_core::ArrowString); -impl From for AffixFuzzer9 { +impl From<::re_types_core::ArrowString> for AffixFuzzer9 { #[inline] - fn from(single_string_required: crate::ArrowString) -> Self { + fn from(single_string_required: ::re_types_core::ArrowString) -> Self { Self(single_string_required) } } -impl From for crate::ArrowString { +impl From for ::re_types_core::ArrowString { #[inline] fn from(value: AffixFuzzer9) -> Self { value.0 @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer9> for ::std::borrow::Cow<'a, AffixFuzzer9> { } } -impl crate::Loggable for AffixFuzzer9 { - type Name = crate::ComponentName; +impl ::re_types_core::Loggable for AffixFuzzer9 { + type Name = ::re_types_core::ComponentName; #[inline] fn name() -> Self::Name { @@ -63,13 +63,13 @@ impl crate::Loggable for AffixFuzzer9 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -114,19 +114,19 @@ impl crate::Loggable for AffixFuzzer9 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -143,7 +143,7 @@ impl crate::Loggable for AffixFuzzer9 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -156,15 +156,15 @@ impl crate::Loggable for AffixFuzzer9 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString(v))) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer9#single_string_required")? .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.components.AffixFuzzer9#single_string_required") .with_context("rerun.testing.components.AffixFuzzer9")?) } diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs index f1db5bb870a4..df17b1870d22 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer1.rs @@ -17,11 +17,11 @@ #[derive(Clone, Debug, Default, PartialEq)] pub struct AffixFuzzer1 { pub single_float_optional: Option, - pub single_string_required: crate::ArrowString, - pub single_string_optional: Option, - pub many_floats_optional: Option>, - pub many_strings_required: Vec, - pub many_strings_optional: Option>, + pub single_string_required: ::re_types_core::ArrowString, + pub single_string_optional: Option<::re_types_core::ArrowString>, + pub many_floats_optional: Option<::re_types_core::ArrowBuffer>, + pub many_strings_required: Vec<::re_types_core::ArrowString>, + pub many_strings_optional: Option>, pub flattened_scalar: f32, pub almost_flattened_scalar: crate::testing::datatypes::FlattenedScalar, pub from_parent: Option, @@ -41,8 +41,8 @@ impl<'a> From<&'a AffixFuzzer1> for ::std::borrow::Cow<'a, AffixFuzzer1> { } } -impl crate::Loggable for AffixFuzzer1 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer1 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -129,13 +129,13 @@ impl crate::Loggable for AffixFuzzer1 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -581,19 +581,19 @@ impl crate::Loggable for AffixFuzzer1 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "single_float_optional".to_owned(), @@ -682,7 +682,7 @@ impl crate::Loggable for AffixFuzzer1 { .collect(); let single_float_optional = { if !arrays_by_name.contains_key("single_float_optional") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "single_float_optional", )) @@ -693,7 +693,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -704,7 +704,7 @@ impl crate::Loggable for AffixFuzzer1 { }; let single_string_required = { if !arrays_by_name.contains_key("single_string_required") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "single_string_required", )) @@ -716,7 +716,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -735,10 +735,12 @@ impl crate::Loggable for AffixFuzzer1 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -749,9 +751,11 @@ impl crate::Loggable for AffixFuzzer1 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context( "rerun.testing.datatypes.AffixFuzzer1#single_string_required", )? @@ -760,7 +764,7 @@ impl crate::Loggable for AffixFuzzer1 { }; let single_string_optional = { if !arrays_by_name.contains_key("single_string_optional") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "single_string_optional", )) @@ -772,7 +776,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -791,10 +795,12 @@ impl crate::Loggable for AffixFuzzer1 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -805,9 +811,11 @@ impl crate::Loggable for AffixFuzzer1 { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context( "rerun.testing.datatypes.AffixFuzzer1#single_string_optional", )? @@ -816,7 +824,7 @@ impl crate::Loggable for AffixFuzzer1 { }; let many_floats_optional = { if !arrays_by_name.contains_key("many_floats_optional") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "many_floats_optional", )) @@ -828,7 +836,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float32, @@ -844,21 +852,22 @@ impl crate::Loggable for AffixFuzzer1 { if arrow_data.is_empty() { Vec::new() } else { - let arrow_data_inner = - { - let arrow_data_inner = &**arrow_data.values(); - arrow_data_inner + let arrow_data_inner = { + let arrow_data_inner = &**arrow_data.values(); + arrow_data_inner .as_any() .downcast_ref::() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( - DataType::Float32, - arrow_data_inner.data_type().clone(), - )) + .ok_or_else(|| { + ::re_types_core::DeserializationError::datatype_mismatch( + DataType::Float32, + arrow_data_inner.data_type().clone(), + ) + }) .with_context( "rerun.testing.datatypes.AffixFuzzer1#many_floats_optional", )? .values() - }; + }; let offsets = arrow_data.offsets(); arrow2::bitmap::utils::ZipValidity::new_with_validity( offsets.iter().zip(offsets.lengths()), @@ -869,10 +878,12 @@ impl crate::Loggable for AffixFuzzer1 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -881,19 +892,19 @@ impl crate::Loggable for AffixFuzzer1 { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } }; let many_strings_required = { if !arrays_by_name.contains_key("many_strings_required") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "many_strings_required", )) @@ -905,7 +916,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, @@ -927,7 +938,7 @@ impl crate::Loggable for AffixFuzzer1 { let arrow_data_inner = arrow_data_inner .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data_inner.data_type().clone(), )) @@ -947,7 +958,7 @@ impl crate::Loggable for AffixFuzzer1 { let end = start + len; if end as usize > arrow_data_inner_buf.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner_buf.len(), ), @@ -964,9 +975,13 @@ impl crate::Loggable for AffixFuzzer1 { }) .map(|res_or_opt| { res_or_opt - .map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + .map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::< + ::re_types_core::DeserializationResult>>, + >() .with_context( "rerun.testing.datatypes.AffixFuzzer1#many_strings_required", )? @@ -986,7 +1001,7 @@ impl crate::Loggable for AffixFuzzer1 { let end = start + len; if end as usize > arrow_data_inner.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), ), @@ -1006,14 +1021,16 @@ impl crate::Loggable for AffixFuzzer1 { }) .transpose() }) - .collect::>>>()? + .collect::< + ::re_types_core::DeserializationResult>>, + >()? } .into_iter() } }; let many_strings_optional = { if !arrays_by_name.contains_key("many_strings_optional") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "many_strings_optional", )) @@ -1025,7 +1042,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Utf8, @@ -1047,7 +1064,7 @@ impl crate::Loggable for AffixFuzzer1 { let arrow_data_inner = arrow_data_inner .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data_inner.data_type().clone(), )) @@ -1067,7 +1084,7 @@ impl crate::Loggable for AffixFuzzer1 { let end = start + len; if end as usize > arrow_data_inner_buf.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner_buf.len(), ), @@ -1084,9 +1101,13 @@ impl crate::Loggable for AffixFuzzer1 { }) .map(|res_or_opt| { res_or_opt - .map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + .map(|res_or_opt| { + res_or_opt.map(|v| ::re_types_core::ArrowString(v)) + }) }) - .collect::>>>() + .collect::< + ::re_types_core::DeserializationResult>>, + >() .with_context( "rerun.testing.datatypes.AffixFuzzer1#many_strings_optional", )? @@ -1106,7 +1127,7 @@ impl crate::Loggable for AffixFuzzer1 { let end = start + len; if end as usize > arrow_data_inner.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), ), @@ -1126,14 +1147,16 @@ impl crate::Loggable for AffixFuzzer1 { }) .transpose() }) - .collect::>>>()? + .collect::< + ::re_types_core::DeserializationResult>>, + >()? } .into_iter() } }; let flattened_scalar = { if !arrays_by_name.contains_key("flattened_scalar") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "flattened_scalar", )) @@ -1144,7 +1167,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -1155,7 +1178,7 @@ impl crate::Loggable for AffixFuzzer1 { }; let almost_flattened_scalar = { if !arrays_by_name.contains_key("almost_flattened_scalar") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "almost_flattened_scalar", )) @@ -1170,7 +1193,7 @@ impl crate::Loggable for AffixFuzzer1 { }; let from_parent = { if !arrays_by_name.contains_key("from_parent") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "from_parent", )) @@ -1181,7 +1204,7 @@ impl crate::Loggable for AffixFuzzer1 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Boolean, arrow_data.data_type().clone(), ) @@ -1215,25 +1238,33 @@ impl crate::Loggable for AffixFuzzer1 { Ok(Self { single_float_optional, single_string_required: single_string_required - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer1#single_string_required", )?, single_string_optional, many_floats_optional, many_strings_required: many_strings_required - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer1#many_strings_required", )?, many_strings_optional, flattened_scalar: flattened_scalar - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer1#flattened_scalar", )?, almost_flattened_scalar: almost_flattened_scalar - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer1#almost_flattened_scalar", )?, @@ -1241,7 +1272,7 @@ impl crate::Loggable for AffixFuzzer1 { })) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.AffixFuzzer1")? } }) diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer2.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer2.rs index 3344194dcd7e..432e7c0b5e96 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer2.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer2.rs @@ -45,8 +45,8 @@ impl<'a> From<&'a AffixFuzzer2> for ::std::borrow::Cow<'a, AffixFuzzer2> { } } -impl crate::Loggable for AffixFuzzer2 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer2 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -63,13 +63,13 @@ impl crate::Loggable for AffixFuzzer2 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -100,18 +100,18 @@ impl crate::Loggable for AffixFuzzer2 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -121,7 +121,7 @@ impl crate::Loggable for AffixFuzzer2 { .map(|opt| opt.copied()) .map(Ok) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.datatypes.AffixFuzzer2#single_float_optional") .with_context("rerun.testing.datatypes.AffixFuzzer2")?) } diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs index 6bb173ffd1ed..1204be638b16 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer20.rs @@ -34,8 +34,8 @@ impl<'a> From<&'a AffixFuzzer20> for ::std::borrow::Cow<'a, AffixFuzzer20> { } } -impl crate::Loggable for AffixFuzzer20 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer20 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -65,13 +65,13 @@ impl crate::Loggable for AffixFuzzer20 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -180,20 +180,20 @@ impl crate::Loggable for AffixFuzzer20 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name : "p".to_owned(), data_type : < crate ::testing::datatypes::PrimitiveComponent > @@ -219,7 +219,7 @@ impl crate::Loggable for AffixFuzzer20 { .collect(); let p = { if !arrays_by_name.contains_key("p") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "p", )) @@ -230,7 +230,7 @@ impl crate::Loggable for AffixFuzzer20 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) @@ -244,7 +244,7 @@ impl crate::Loggable for AffixFuzzer20 { }; let s = { if !arrays_by_name.contains_key("s") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "s", )) @@ -256,7 +256,7 @@ impl crate::Loggable for AffixFuzzer20 { .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -273,10 +273,12 @@ impl crate::Loggable for AffixFuzzer20 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_buf.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_buf.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -289,13 +291,13 @@ impl crate::Loggable for AffixFuzzer20 { .map(|res_or_opt| { res_or_opt.map(|res_or_opt| { res_or_opt.map(|v| { - crate::testing::datatypes::StringComponent(crate::ArrowString( - v, - )) + crate::testing::datatypes::StringComponent( + ::re_types_core::ArrowString(v), + ) }) }) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.datatypes.AffixFuzzer20#s")? .into_iter() } @@ -307,15 +309,15 @@ impl crate::Loggable for AffixFuzzer20 { .map(|opt| { opt.map(|(p, s)| { Ok(Self { - p: p.ok_or_else(crate::DeserializationError::missing_data) + p: p.ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.datatypes.AffixFuzzer20#p")?, - s: s.ok_or_else(crate::DeserializationError::missing_data) + s: s.ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.datatypes.AffixFuzzer20#s")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.AffixFuzzer20")? } }) diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs index 488e32703686..092dfdcceddc 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer21.rs @@ -17,7 +17,7 @@ #[derive(Clone, Debug, Default, PartialEq)] pub struct AffixFuzzer21 { pub single_half: arrow2::types::f16, - pub many_halves: crate::ArrowBuffer, + pub many_halves: ::re_types_core::ArrowBuffer, } impl<'a> From for ::std::borrow::Cow<'a, AffixFuzzer21> { @@ -34,8 +34,8 @@ impl<'a> From<&'a AffixFuzzer21> for ::std::borrow::Cow<'a, AffixFuzzer21> { } } -impl crate::Loggable for AffixFuzzer21 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer21 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -70,13 +70,13 @@ impl crate::Loggable for AffixFuzzer21 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -180,19 +180,19 @@ impl crate::Loggable for AffixFuzzer21 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![ Field { name: "single_half".to_owned(), @@ -228,7 +228,7 @@ impl crate::Loggable for AffixFuzzer21 { .collect(); let single_half = { if !arrays_by_name.contains_key("single_half") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "single_half", )) @@ -239,7 +239,7 @@ impl crate::Loggable for AffixFuzzer21 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float16, arrow_data.data_type().clone(), ) @@ -250,7 +250,7 @@ impl crate::Loggable for AffixFuzzer21 { }; let many_halves = { if !arrays_by_name.contains_key("many_halves") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "many_halves", )) @@ -262,7 +262,7 @@ impl crate::Loggable for AffixFuzzer21 { .as_any() .downcast_ref::<::arrow2::array::ListArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::List(Box::new(Field { name: "item".to_owned(), data_type: DataType::Float16, @@ -282,7 +282,7 @@ impl crate::Loggable for AffixFuzzer21 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float16, arrow_data_inner.data_type().clone(), ) @@ -302,10 +302,12 @@ impl crate::Loggable for AffixFuzzer21 { let start = *start as usize; let end = start + len; if end as usize > arrow_data_inner.len() { - return Err(crate::DeserializationError::offset_slice_oob( - (start, end), - arrow_data_inner.len(), - )); + return Err( + ::re_types_core::DeserializationError::offset_slice_oob( + (start, end), + arrow_data_inner.len(), + ), + ); } #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -314,12 +316,12 @@ impl crate::Loggable for AffixFuzzer21 { .clone() .sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); Ok(data) }) .transpose() }) - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() } @@ -332,12 +334,12 @@ impl crate::Loggable for AffixFuzzer21 { opt.map(|(single_half, many_halves)| { Ok(Self { single_half: single_half - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.testing.datatypes.AffixFuzzer21#single_half", )?, many_halves: many_halves - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context( "rerun.testing.datatypes.AffixFuzzer21#many_halves", )?, @@ -345,7 +347,7 @@ impl crate::Loggable for AffixFuzzer21 { }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.AffixFuzzer21")? } }) diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs index ba990b4188e9..319980a00587 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer3.rs @@ -36,8 +36,8 @@ impl<'a> From<&'a AffixFuzzer3> for ::std::borrow::Cow<'a, AffixFuzzer3> { } } -impl crate::Loggable for AffixFuzzer3 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer3 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -102,13 +102,13 @@ impl crate::Loggable for AffixFuzzer3 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -346,19 +346,19 @@ impl crate::Loggable for AffixFuzzer3 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { name : "_null_markers".to_owned(), data_type : @@ -393,14 +393,14 @@ impl crate::Loggable for AffixFuzzer3 { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.testing.datatypes.AffixFuzzer3")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -415,7 +415,7 @@ impl crate::Loggable for AffixFuzzer3 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -434,7 +434,7 @@ impl crate::Loggable for AffixFuzzer3 { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -453,7 +453,7 @@ impl crate::Loggable for AffixFuzzer3 { let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::List( Box::new(Field { name: "item".to_owned(), @@ -493,7 +493,7 @@ impl crate::Loggable for AffixFuzzer3 { let end = start + len; if end as usize > arrow_data_inner.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), ), @@ -513,7 +513,9 @@ impl crate::Loggable for AffixFuzzer3 { }) .transpose() }) - .collect::>>>()? + .collect::< + ::re_types_core::DeserializationResult>>, + >()? } .into_iter() } @@ -528,7 +530,7 @@ impl crate::Loggable for AffixFuzzer3 { let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::FixedSizeListArray>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::FixedSizeList( Box::new(Field { name: "item".to_owned(), @@ -554,7 +556,7 @@ impl crate::Loggable for AffixFuzzer3 { arrow_data_inner .as_any() .downcast_ref::() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data_inner.data_type().clone(), )) @@ -575,7 +577,7 @@ impl crate::Loggable for AffixFuzzer3 { debug_assert!(end - start == 3usize); if end as usize > arrow_data_inner.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), ), @@ -595,7 +597,9 @@ impl crate::Loggable for AffixFuzzer3 { }) .transpose() }) - .collect::>>>()? + .collect::< + ::re_types_core::DeserializationResult>>, + >()? } .into_iter() } @@ -616,7 +620,7 @@ impl crate::Loggable for AffixFuzzer3 { AffixFuzzer3::Degrees({ if offset as usize >= degrees.len() { return Err( - crate::DeserializationError::offset_oob( + ::re_types_core::DeserializationError::offset_oob( offset as _, degrees.len(), ), @@ -629,7 +633,9 @@ impl crate::Loggable for AffixFuzzer3 { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { degrees.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer3#degrees", )? @@ -639,7 +645,7 @@ impl crate::Loggable for AffixFuzzer3 { AffixFuzzer3::Radians({ if offset as usize >= radians.len() { return Err( - crate::DeserializationError::offset_oob( + ::re_types_core::DeserializationError::offset_oob( offset as _, radians.len(), ), @@ -657,7 +663,7 @@ impl crate::Loggable for AffixFuzzer3 { AffixFuzzer3::Craziness({ if offset as usize >= craziness.len() { return Err( - crate::DeserializationError::offset_oob( + ::re_types_core::DeserializationError::offset_oob( offset as _, craziness.len(), ), @@ -670,7 +676,9 @@ impl crate::Loggable for AffixFuzzer3 { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { craziness.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer3#craziness", )? @@ -680,7 +688,7 @@ impl crate::Loggable for AffixFuzzer3 { AffixFuzzer3::FixedSizeShenanigans({ if offset as usize >= fixed_size_shenanigans.len() { return Err( - crate::DeserializationError::offset_oob( + ::re_types_core::DeserializationError::offset_oob( offset as _, fixed_size_shenanigans.len(), ), @@ -695,7 +703,9 @@ impl crate::Loggable for AffixFuzzer3 { fixed_size_shenanigans.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer3#fixed_size_shenanigans", )? @@ -703,7 +713,7 @@ impl crate::Loggable for AffixFuzzer3 { } _ => { return Err( - crate::DeserializationError::missing_union_arm( + ::re_types_core::DeserializationError::missing_union_arm( Self::arrow_datatype(), "", *typ as _, @@ -716,7 +726,7 @@ impl crate::Loggable for AffixFuzzer3 { ) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.AffixFuzzer3")? } }) diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs index ef4446c2ca21..ca674c6a2414 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer4.rs @@ -35,8 +35,8 @@ impl<'a> From<&'a AffixFuzzer4> for ::std::borrow::Cow<'a, AffixFuzzer4> { } } -impl crate::Loggable for AffixFuzzer4 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer4 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -92,13 +92,13 @@ impl crate::Loggable for AffixFuzzer4 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let data: Vec<_> = data .into_iter() @@ -293,19 +293,19 @@ impl crate::Loggable for AffixFuzzer4 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::UnionArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Union( vec![ Field { name : "_null_markers".to_owned(), data_type : @@ -340,14 +340,14 @@ impl crate::Loggable for AffixFuzzer4 { let arrow_data_offsets = arrow_data .offsets() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( Self::arrow_datatype(), arrow_data.data_type().clone(), ) }) .with_context("rerun.testing.datatypes.AffixFuzzer4")?; if arrow_data_types.len() != arrow_data_offsets.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, arrow_data_types.len()), arrow_data_offsets.len(), )) @@ -372,7 +372,7 @@ impl crate::Loggable for AffixFuzzer4 { let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::List( Box::new(Field { name: "item".to_owned(), @@ -412,7 +412,7 @@ impl crate::Loggable for AffixFuzzer4 { let end = start + len; if end as usize > arrow_data_inner.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), ), @@ -432,7 +432,9 @@ impl crate::Loggable for AffixFuzzer4 { }) .transpose() }) - .collect::>>>()? + .collect::< + ::re_types_core::DeserializationResult>>, + >()? } .into_iter() } @@ -447,7 +449,7 @@ impl crate::Loggable for AffixFuzzer4 { let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::ListArray>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( DataType::List( Box::new(Field { name: "item".to_owned(), @@ -487,7 +489,7 @@ impl crate::Loggable for AffixFuzzer4 { let end = start + len; if end as usize > arrow_data_inner.len() { return Err( - crate::DeserializationError::offset_slice_oob( + ::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_inner.len(), ), @@ -507,7 +509,9 @@ impl crate::Loggable for AffixFuzzer4 { }) .transpose() }) - .collect::>>>()? + .collect::< + ::re_types_core::DeserializationResult>>, + >()? } .into_iter() } @@ -524,10 +528,12 @@ impl crate::Loggable for AffixFuzzer4 { Ok(Some(match typ { 1i8 => AffixFuzzer4::SingleRequired({ if offset as usize >= single_required.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - single_required.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + single_required.len(), + ), + ) .with_context( "rerun.testing.datatypes.AffixFuzzer4#single_required", ); @@ -536,17 +542,21 @@ impl crate::Loggable for AffixFuzzer4 { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { single_required.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer4#single_required", )? }), 2i8 => AffixFuzzer4::ManyRequired({ if offset as usize >= many_required.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - many_required.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + many_required.len(), + ), + ) .with_context( "rerun.testing.datatypes.AffixFuzzer4#many_required", ); @@ -555,17 +565,21 @@ impl crate::Loggable for AffixFuzzer4 { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] unsafe { many_required.get_unchecked(offset as usize) } .clone() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else( + ::re_types_core::DeserializationError::missing_data, + ) .with_context( "rerun.testing.datatypes.AffixFuzzer4#many_required", )? }), 3i8 => AffixFuzzer4::ManyOptional({ if offset as usize >= many_optional.len() { - return Err(crate::DeserializationError::offset_oob( - offset as _, - many_optional.len(), - )) + return Err( + ::re_types_core::DeserializationError::offset_oob( + offset as _, + many_optional.len(), + ), + ) .with_context( "rerun.testing.datatypes.AffixFuzzer4#many_optional", ); @@ -575,17 +589,19 @@ impl crate::Loggable for AffixFuzzer4 { unsafe { many_optional.get_unchecked(offset as usize) }.clone() }), _ => { - return Err(crate::DeserializationError::missing_union_arm( - Self::arrow_datatype(), - "", - *typ as _, - )) + return Err( + ::re_types_core::DeserializationError::missing_union_arm( + Self::arrow_datatype(), + "", + *typ as _, + ), + ) .with_context("rerun.testing.datatypes.AffixFuzzer4"); } })) } }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.AffixFuzzer4")? } }) diff --git a/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs b/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs index a0f8962838e6..01aa44648720 100644 --- a/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs +++ b/crates/re_types/src/testing/datatypes/affix_fuzzer5.rs @@ -57,8 +57,8 @@ impl<'a> From<&'a AffixFuzzer5> for ::std::borrow::Cow<'a, AffixFuzzer5> { } } -impl crate::Loggable for AffixFuzzer5 { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for AffixFuzzer5 { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -80,13 +80,13 @@ impl crate::Loggable for AffixFuzzer5 { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -138,19 +138,19 @@ impl crate::Loggable for AffixFuzzer5 { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![Field { name: "single_optional_union".to_owned(), data_type: ::arrow_datatype(), @@ -173,7 +173,7 @@ impl crate::Loggable for AffixFuzzer5 { .collect(); let single_optional_union = { if !arrays_by_name.contains_key("single_optional_union") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "single_optional_union", )) @@ -196,7 +196,7 @@ impl crate::Loggable for AffixFuzzer5 { }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.AffixFuzzer5")? } }) diff --git a/crates/re_types/src/testing/datatypes/flattened_scalar.rs b/crates/re_types/src/testing/datatypes/flattened_scalar.rs index b83ed88f833a..bff5f04431ff 100644 --- a/crates/re_types/src/testing/datatypes/flattened_scalar.rs +++ b/crates/re_types/src/testing/datatypes/flattened_scalar.rs @@ -47,8 +47,8 @@ impl<'a> From<&'a FlattenedScalar> for ::std::borrow::Cow<'a, FlattenedScalar> { } } -impl crate::Loggable for FlattenedScalar { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for FlattenedScalar { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -70,13 +70,13 @@ impl crate::Loggable for FlattenedScalar { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data): (Vec<_>, Vec<_>) = data .into_iter() @@ -122,19 +122,19 @@ impl crate::Loggable for FlattenedScalar { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::StructArray>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Struct(vec![Field { name: "value".to_owned(), data_type: DataType::Float32, @@ -157,7 +157,7 @@ impl crate::Loggable for FlattenedScalar { .collect(); let value = { if !arrays_by_name.contains_key("value") { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( Self::arrow_datatype(), "value", )) @@ -168,7 +168,7 @@ impl crate::Loggable for FlattenedScalar { .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Float32, arrow_data.data_type().clone(), ) @@ -185,13 +185,13 @@ impl crate::Loggable for FlattenedScalar { opt.map(|(value)| { Ok(Self { value: value - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context("rerun.testing.datatypes.FlattenedScalar#value")?, }) }) .transpose() }) - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context("rerun.testing.datatypes.FlattenedScalar")? } }) diff --git a/crates/re_types/src/testing/datatypes/primitive_component.rs b/crates/re_types/src/testing/datatypes/primitive_component.rs index 5371354d9f9f..f82200fa1f59 100644 --- a/crates/re_types/src/testing/datatypes/primitive_component.rs +++ b/crates/re_types/src/testing/datatypes/primitive_component.rs @@ -46,8 +46,8 @@ impl<'a> From<&'a PrimitiveComponent> for ::std::borrow::Cow<'a, PrimitiveCompon } } -impl crate::Loggable for PrimitiveComponent { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for PrimitiveComponent { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -64,13 +64,13 @@ impl crate::Loggable for PrimitiveComponent { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -99,18 +99,18 @@ impl crate::Loggable for PrimitiveComponent { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(arrow_data .as_any() .downcast_ref::() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::UInt32, arrow_data.data_type().clone(), ) @@ -118,9 +118,9 @@ impl crate::Loggable for PrimitiveComponent { .with_context("rerun.testing.datatypes.PrimitiveComponent#value")? .into_iter() .map(|opt| opt.copied()) - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.datatypes.PrimitiveComponent#value") .with_context("rerun.testing.datatypes.PrimitiveComponent")?) } diff --git a/crates/re_types/src/testing/datatypes/string_component.rs b/crates/re_types/src/testing/datatypes/string_component.rs index 6f7f9d402331..758e19db178d 100644 --- a/crates/re_types/src/testing/datatypes/string_component.rs +++ b/crates/re_types/src/testing/datatypes/string_component.rs @@ -16,16 +16,16 @@ #[derive(Clone, Debug, Default, Eq, PartialEq)] #[repr(transparent)] -pub struct StringComponent(pub crate::ArrowString); +pub struct StringComponent(pub ::re_types_core::ArrowString); -impl From for StringComponent { +impl From<::re_types_core::ArrowString> for StringComponent { #[inline] - fn from(value: crate::ArrowString) -> Self { + fn from(value: ::re_types_core::ArrowString) -> Self { Self(value) } } -impl From for crate::ArrowString { +impl From for ::re_types_core::ArrowString { #[inline] fn from(value: StringComponent) -> Self { value.0 @@ -46,8 +46,8 @@ impl<'a> From<&'a StringComponent> for ::std::borrow::Cow<'a, StringComponent> { } } -impl crate::Loggable for StringComponent { - type Name = crate::DatatypeName; +impl ::re_types_core::Loggable for StringComponent { + type Name = ::re_types_core::DatatypeName; #[inline] fn name() -> Self::Name { @@ -64,13 +64,13 @@ impl crate::Loggable for StringComponent { #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let (somes, data0): (Vec<_>, Vec<_>) = data .into_iter() @@ -115,19 +115,19 @@ impl crate::Loggable for StringComponent { #[allow(unused_imports, clippy::wildcard_imports)] fn from_arrow_opt( arrow_data: &dyn ::arrow2::array::Array, - ) -> crate::DeserializationResult>> + ) -> ::re_types_core::DeserializationResult>> where Self: Sized, { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; use ::arrow2::{array::*, buffer::*, datatypes::*}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok({ let arrow_data = arrow_data .as_any() .downcast_ref::<::arrow2::array::Utf8Array>() .ok_or_else(|| { - crate::DeserializationError::datatype_mismatch( + ::re_types_core::DeserializationError::datatype_mismatch( DataType::Utf8, arrow_data.data_type().clone(), ) @@ -144,7 +144,7 @@ impl crate::Loggable for StringComponent { let start = *start as usize; let end = start + len; if end as usize > arrow_data_buf.len() { - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), arrow_data_buf.len(), )); @@ -157,15 +157,15 @@ impl crate::Loggable for StringComponent { .transpose() }) .map(|res_or_opt| { - res_or_opt.map(|res_or_opt| res_or_opt.map(|v| crate::ArrowString(v))) + res_or_opt.map(|res_or_opt| res_or_opt.map(|v| ::re_types_core::ArrowString(v))) }) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.datatypes.StringComponent#value")? .into_iter() } - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) .map(|res| res.map(|v| Some(Self(v)))) - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context("rerun.testing.datatypes.StringComponent#value") .with_context("rerun.testing.datatypes.StringComponent")?) } diff --git a/crates/re_types/src/testing/mod.rs b/crates/re_types/src/testing/mod.rs index d710d9f1afc7..0509404bcb8b 100644 --- a/crates/re_types/src/testing/mod.rs +++ b/crates/re_types/src/testing/mod.rs @@ -19,7 +19,7 @@ pub fn build_some_large_structs(len: usize) -> Vec { many_strings_required: ["hello", "friend", "let's", "test!"] .into_iter() .take(i % 5) - .map(crate::ArrowString::from) + .map(::re_types_core::ArrowString::from) .collect(), many_strings_optional: None, flattened_scalar: i as f32, diff --git a/crates/re_types_builder/src/codegen/rust/api.rs b/crates/re_types_builder/src/codegen/rust/api.rs index 1e3a47771bd0..799594aaac8f 100644 --- a/crates/re_types_builder/src/codegen/rust/api.rs +++ b/crates/re_types_builder/src/codegen/rust/api.rs @@ -627,7 +627,7 @@ impl quote::ToTokens for TypeTokenizer<'_> { Type::Float16 => quote!(arrow2::types::f16), Type::Float32 => quote!(f32), Type::Float64 => quote!(f64), - Type::String => quote!(crate::ArrowString), + Type::String => quote!(::re_types_core::ArrowString), Type::Array { elem_type, length } => { if *unwrap { quote!(#elem_type) @@ -639,7 +639,7 @@ impl quote::ToTokens for TypeTokenizer<'_> { if *unwrap { quote!(#elem_type) } else if elem_type.backed_by_arrow_buffer() { - quote!(crate::ArrowBuffer<#elem_type>) + quote!(::re_types_core::ArrowBuffer<#elem_type>) } else { quote!(Vec<#elem_type>) } @@ -665,7 +665,7 @@ impl quote::ToTokens for &ElementType { ElementType::Float16 => quote!(arrow2::types::f16), ElementType::Float32 => quote!(f32), ElementType::Float64 => quote!(f64), - ElementType::String => quote!(crate::ArrowString), + ElementType::String => quote!(::re_types_core::ArrowString), ElementType::Object(fqname) => quote_fqname_as_type_path(fqname), } .to_tokens(tokens); @@ -752,19 +752,19 @@ fn quote_trait_impls_from_obj( quote! { #[allow(unused_imports, clippy::wildcard_imports)] #[inline] - fn from_arrow(arrow_data: &dyn ::arrow2::array::Array) -> crate::DeserializationResult> + fn from_arrow(arrow_data: &dyn ::arrow2::array::Array) -> ::re_types_core::DeserializationResult> where Self: Sized { re_tracing::profile_function!(); use ::arrow2::{datatypes::*, array::*, buffer::*}; - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; // This code-path cannot have null fields. If it does have a validity mask // all bits must indicate valid data. if let Some(validity) = arrow_data.validity() { if validity.unset_bits() != 0 { - return Err(crate::DeserializationError::missing_data()); + return Err(::re_types_core::DeserializationError::missing_data()); } } @@ -778,8 +778,8 @@ fn quote_trait_impls_from_obj( quote! { #into_cow - impl crate::Loggable for #name { - type Name = crate::#kind_name; + impl ::re_types_core::Loggable for #name { + type Name = ::re_types_core::#kind_name; #[inline] fn name() -> Self::Name { @@ -797,28 +797,30 @@ fn quote_trait_impls_from_obj( #[allow(unused_imports, clippy::wildcard_imports)] fn to_arrow_opt<'a>( data: impl IntoIterator>>>, - ) -> crate::SerializationResult> + ) -> ::re_types_core::SerializationResult> where Self: Clone + 'a { re_tracing::profile_function!(); use ::arrow2::{datatypes::*, array::*}; - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(#quoted_serializer) } // NOTE: Don't inline this, this gets _huge_. #[allow(unused_imports, clippy::wildcard_imports)] - fn from_arrow_opt(arrow_data: &dyn ::arrow2::array::Array) -> crate::DeserializationResult>> + fn from_arrow_opt( + arrow_data: &dyn ::arrow2::array::Array, + ) -> ::re_types_core::DeserializationResult>> where Self: Sized { re_tracing::profile_function!(); use ::arrow2::{datatypes::*, array::*, buffer::*}; - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; Ok(#quoted_deserializer) } @@ -867,7 +869,7 @@ fn quote_trait_impls_from_obj( let quoted_indicator_name = format_ident!("{indicator_name}"); let quoted_indicator_doc = - format!("Indicator component for the [`{name}`] [`crate::Archetype`]"); + format!("Indicator component for the [`{name}`] [`::re_types_core::Archetype`]"); let (num_required, required) = compute_components(obj, ATTR_RERUN_COMPONENT_REQUIRED, []); @@ -903,13 +905,13 @@ fn quote_trait_impls_from_obj( // the nullability of individual elements (i.e. instances)! match (is_plural, is_nullable) { (true, true) => quote! { - self.#field_name.as_ref().map(|comp_batch| (comp_batch as &dyn crate::ComponentBatch).into()) + self.#field_name.as_ref().map(|comp_batch| (comp_batch as &dyn ::re_types_core::ComponentBatch).into()) }, (false, true) => quote! { - self.#field_name.as_ref().map(|comp| (comp as &dyn crate::ComponentBatch).into()) + self.#field_name.as_ref().map(|comp| (comp as &dyn ::re_types_core::ComponentBatch).into()) }, (_, false) => quote! { - Some((&self.#field_name as &dyn crate::ComponentBatch).into()) + Some((&self.#field_name as &dyn ::re_types_core::ComponentBatch).into()) } } })) @@ -930,8 +932,8 @@ fn quote_trait_impls_from_obj( let quoted_collection = if is_plural { quote! { .into_iter() - .map(|v| v.ok_or_else(crate::DeserializationError::missing_data)) - .collect::>>() + .map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data)) + .collect::<::re_types_core::DeserializationResult>>() .with_context(#obj_field_fqname)? } } else { @@ -939,7 +941,7 @@ fn quote_trait_impls_from_obj( .into_iter() .next() .flatten() - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context(#obj_field_fqname)? } }; @@ -962,7 +964,7 @@ fn quote_trait_impls_from_obj( quote! {{ let array = arrays_by_name .get(#field_typ_fqname_str) - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context(#obj_field_fqname)?; <#component>::from_arrow_opt(&**array).with_context(#obj_field_fqname)? #quoted_collection @@ -974,16 +976,16 @@ fn quote_trait_impls_from_obj( }; quote! { - static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; #num_required]> = + static REQUIRED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; #num_required]> = once_cell::sync::Lazy::new(|| {[#required]}); - static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; #num_recommended]> = + static RECOMMENDED_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; #num_recommended]> = once_cell::sync::Lazy::new(|| {[#recommended]}); - static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; #num_optional]> = + static OPTIONAL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; #num_optional]> = once_cell::sync::Lazy::new(|| {[#optional]}); - static ALL_COMPONENTS: once_cell::sync::Lazy<[crate::ComponentName; #num_all]> = + static ALL_COMPONENTS: once_cell::sync::Lazy<[::re_types_core::ComponentName; #num_all]> = once_cell::sync::Lazy::new(|| {[#required #recommended #optional]}); impl #name { @@ -991,50 +993,50 @@ fn quote_trait_impls_from_obj( } #[doc = #quoted_indicator_doc] - pub type #quoted_indicator_name = crate::GenericIndicatorComponent<#name>; + pub type #quoted_indicator_name = ::re_types_core::GenericIndicatorComponent<#name>; - impl crate::Archetype for #name { + impl ::re_types_core::Archetype for #name { type Indicator = #quoted_indicator_name; #[inline] - fn name() -> crate::ArchetypeName { + fn name() -> ::re_types_core::ArchetypeName { #fqname.into() } #[inline] - fn indicator() -> crate::MaybeOwnedComponentBatch<'static> { + fn indicator() -> ::re_types_core::MaybeOwnedComponentBatch<'static> { static INDICATOR: #quoted_indicator_name = #quoted_indicator_name::DEFAULT; - crate::MaybeOwnedComponentBatch::Ref(&INDICATOR) + ::re_types_core::MaybeOwnedComponentBatch::Ref(&INDICATOR) } #[inline] - fn required_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn required_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { REQUIRED_COMPONENTS.as_slice().into() } #[inline] - fn recommended_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn recommended_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { RECOMMENDED_COMPONENTS.as_slice().into() } #[inline] - fn optional_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn optional_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { OPTIONAL_COMPONENTS.as_slice().into() } // NOTE: Don't rely on default implementation so that we can keep everything static. #[inline] - fn all_components() -> ::std::borrow::Cow<'static, [crate::ComponentName]> { + fn all_components() -> ::std::borrow::Cow<'static, [::re_types_core::ComponentName]> { ALL_COMPONENTS.as_slice().into() } #[inline] fn from_arrow( arrow_data: impl IntoIterator)>, - ) -> crate::DeserializationResult { + ) -> ::re_types_core::DeserializationResult { re_tracing::profile_function!(); - use crate::{Loggable as _, ResultExt as _}; + use ::re_types_core::{Loggable as _, ResultExt as _}; let arrays_by_name: ::std::collections::HashMap<_, _> = arrow_data .into_iter() @@ -1048,11 +1050,11 @@ fn quote_trait_impls_from_obj( } } - impl crate::AsComponents for #name { - fn as_component_batches(&self) -> Vec> { + impl ::re_types_core::AsComponents for #name { + fn as_component_batches(&self) -> Vec<::re_types_core::MaybeOwnedComponentBatch<'_>> { re_tracing::profile_function!(); - use crate::Archetype as _; + use ::re_types_core::Archetype as _; [#(#all_component_batches,)*].into_iter().flatten().collect() } diff --git a/crates/re_types_builder/src/codegen/rust/deserializer.rs b/crates/re_types_builder/src/codegen/rust/deserializer.rs index ec94086060e0..9ccb31d3b62e 100644 --- a/crates/re_types_builder/src/codegen/rust/deserializer.rs +++ b/crates/re_types_builder/src/codegen/rust/deserializer.rs @@ -20,7 +20,7 @@ use crate::{ /// /// There is a 1:1 relationship between `quote_arrow_deserializer` and `Loggable::from_arrow_opt`: /// ```ignore -/// fn from_arrow_opt(data: &dyn ::arrow2::array::Array) -> crate::DeserializationResult>> { +/// fn from_arrow_opt(data: &dyn ::arrow2::array::Array) -> ::re_types_core::DeserializationResult>> { /// Ok(#quoted_deserializer) /// } /// ``` @@ -87,7 +87,7 @@ pub fn quote_arrow_deserializer( quote!(.map(Ok)) } else { // error context is appended below during final collection - quote!(.map(|v| v.ok_or_else(crate::DeserializationError::missing_data))) + quote!(.map(|v| v.ok_or_else(::re_types_core::DeserializationError::missing_data))) }; let quoted_remapping = if is_tuple_struct { @@ -101,7 +101,7 @@ pub fn quote_arrow_deserializer( #quoted_unwrapping #quoted_remapping // NOTE: implicit Vec to Result - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() // NOTE: double context so the user can see the transparent shenanigans going on in the // error. .with_context(#obj_field_fqname) @@ -134,7 +134,7 @@ pub fn quote_arrow_deserializer( // looking for at comptime… there's no guarantee it's actually there at // runtime! if !arrays_by_name.contains_key(#field_name) { - return Err(crate::DeserializationError::missing_struct_field( + return Err(::re_types_core::DeserializationError::missing_struct_field( #quoted_datatype, #field_name, )).with_context(#obj_fqname); } @@ -161,7 +161,7 @@ pub fn quote_arrow_deserializer( } else { quote! { #quoted_obj_field_name: #quoted_obj_field_name - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context(#obj_field_fqname)? } } @@ -196,7 +196,7 @@ pub fn quote_arrow_deserializer( ) .map(|opt| opt.map(|(#(#quoted_field_names),*)| Ok(Self { #(#quoted_unwrappings,)* })).transpose()) // NOTE: implicit Vec to Result - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context(#obj_fqname)? } }} @@ -235,7 +235,7 @@ pub fn quote_arrow_deserializer( // send data in. return Ok(Vec::new()); - // return Err(crate::DeserializationError::missing_union_arm( + // return Err(::re_types_core::DeserializationError::missing_union_arm( // #quoted_datatype, #obj_field_fqname, #i, // )).with_context(#obj_fqname); } @@ -260,7 +260,7 @@ pub fn quote_arrow_deserializer( quote!() } else { quote! { - .ok_or_else(crate::DeserializationError::missing_data) + .ok_or_else(::re_types_core::DeserializationError::missing_data) .with_context(#obj_field_fqname)? } }; @@ -271,7 +271,7 @@ pub fn quote_arrow_deserializer( // boundchecks manually first, otherwise rustc completely chokes // when indexing the data (as in: a 100x perf drop)! if offset as usize >= #quoted_obj_field_name.len() { - return Err(crate::DeserializationError::offset_oob( + return Err(::re_types_core::DeserializationError::offset_oob( offset as _, #quoted_obj_field_name.len() )).with_context(#obj_field_fqname); } @@ -303,13 +303,13 @@ pub fn quote_arrow_deserializer( let #data_src_offsets = #data_src.offsets() // NOTE: expected dense union, got a sparse one instead - .ok_or_else(|| crate::DeserializationError::datatype_mismatch( + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch( #quoted_datatype, #data_src.data_type().clone(), )).with_context(#obj_fqname)?; if #data_src_types.len() != #data_src_offsets.len() { // NOTE: need one offset array per union arm! - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (0, #data_src_types.len()), #data_src_offsets.len(), )).with_context(#obj_fqname); } @@ -329,7 +329,7 @@ pub fn quote_arrow_deserializer( Ok(Some(match typ { #(#quoted_branches,)* _ => { - return Err(crate::DeserializationError::missing_union_arm( + return Err(::re_types_core::DeserializationError::missing_union_arm( #quoted_datatype, "", *typ as _, )).with_context(#obj_fqname); } @@ -337,7 +337,7 @@ pub fn quote_arrow_deserializer( } }) // NOTE: implicit Vec to Result - .collect::>>() + .collect::<::re_types_core::DeserializationResult>>() .with_context(#obj_fqname)? } }} @@ -429,7 +429,7 @@ fn quote_arrow_field_deserializer( objects, datatype, IteratorKind::ResultOptionValue, - quote!(crate::ArrowString).into(), + quote!(::re_types_core::ArrowString).into(), ); let data_src_buf = format_ident!("{data_src}_buf"); @@ -454,7 +454,7 @@ fn quote_arrow_field_deserializer( // when slicing the data (as in: a 100x perf drop)! if end as usize > #data_src_buf.len() { // error context is appended below during final collection - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), #data_src_buf.len(), )); } @@ -468,7 +468,7 @@ fn quote_arrow_field_deserializer( ) #quoted_iter_transparency // NOTE: implicit Vec to Result - .collect::>>>() + .collect::<::re_types_core::DeserializationResult>>>() .with_context(#obj_field_fqname)? .into_iter() }} @@ -526,7 +526,7 @@ fn quote_arrow_field_deserializer( // when slicing the data (as in: a 100x perf drop)! if end as usize > #data_src_inner.len() { // error context is appended below during final collection - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), #data_src_inner.len(), )); } @@ -561,8 +561,8 @@ fn quote_arrow_field_deserializer( // // // NOTE: We don't support nullable inner elements in our IDL, so // // this can only be a case of malformed data. - // .map(|opt| opt.ok_or_else(crate::DeserializationError::missing_data)) - // .collect::>>()?; + // .map(|opt| opt.ok_or_else(::re_types_core::DeserializationError::missing_data)) + // .collect::<::re_types_core::DeserializationResult>>()?; // NOTE: Unwrapping cannot fail: the length must be correct. let arr = array_init::from_iter(data).unwrap(); @@ -572,7 +572,7 @@ fn quote_arrow_field_deserializer( ) #quoted_iter_transparency // NOTE: implicit Vec to Result - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() }} @@ -610,7 +610,7 @@ fn quote_arrow_field_deserializer( InnerRepr::BufferT => quote! { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] let data = unsafe { #data_src_inner.clone().sliced_unchecked(start as usize, end - start as usize) }; - let data = crate::ArrowBuffer::from(data); + let data = ::re_types_core::ArrowBuffer::from(data); }, InnerRepr::NativeIterable => quote! { #[allow(unsafe_code, clippy::undocumented_unsafe_blocks)] @@ -643,8 +643,8 @@ fn quote_arrow_field_deserializer( // // // NOTE: We don't support nullable inner elements in our IDL, so // // this can only be a case of malformed data. - // .map(|opt| opt.ok_or_else(crate::DeserializationError::missing_data)) - // .collect::>>()?; + // .map(|opt| opt.ok_or_else(::re_types_core::DeserializationError::missing_data)) + // .collect::<::re_types_core::DeserializationResult>>()?; }, }; @@ -678,7 +678,7 @@ fn quote_arrow_field_deserializer( // when slicing the data (as in: a 100x perf drop)! if end as usize > #data_src_inner.len() { // error context is appended below during final collection - return Err(crate::DeserializationError::offset_slice_oob( + return Err(::re_types_core::DeserializationError::offset_slice_oob( (start, end), #data_src_inner.len(), )); } @@ -689,7 +689,7 @@ fn quote_arrow_field_deserializer( }).transpose() ) // NOTE: implicit Vec to Result - .collect::>>>()? + .collect::<::re_types_core::DeserializationResult>>>()? } .into_iter() }} @@ -722,7 +722,7 @@ fn quote_array_downcast( #arr .as_any() .downcast_ref::<#cast_as>() - .ok_or_else(|| crate::DeserializationError::datatype_mismatch(#expected, #arr.data_type().clone())) + .ok_or_else(|| ::re_types_core::DeserializationError::datatype_mismatch(#expected, #arr.data_type().clone())) .with_context(#location) } } @@ -834,7 +834,7 @@ fn quote_iterator_transparency( /// /// There is a 1:1 relationship between `quote_arrow_deserializer_buffer_slice` and `Loggable::from_arrow`: /// ```ignore -/// fn from_arrow(data: &dyn ::arrow2::array::Array) -> crate::DeserializationResult> { +/// fn from_arrow(data: &dyn ::arrow2::array::Array) -> ::re_types_core::DeserializationResult> { /// Ok(#quoted_deserializer_) /// } /// ``` diff --git a/crates/re_types_core/.gitattributes b/crates/re_types_core/.gitattributes new file mode 100644 index 000000000000..d0ecc4487f58 --- /dev/null +++ b/crates/re_types_core/.gitattributes @@ -0,0 +1,129 @@ +# DO NOT EDIT! This file is generated by crates/re_types_builder/src/lib.rs + +.gitattributes linguist-generated=true +src/archetypes/annotation_context.rs linguist-generated=true +src/archetypes/arrows3d.rs linguist-generated=true +src/archetypes/asset3d.rs linguist-generated=true +src/archetypes/bar_chart.rs linguist-generated=true +src/archetypes/boxes2d.rs linguist-generated=true +src/archetypes/boxes3d.rs linguist-generated=true +src/archetypes/clear.rs linguist-generated=true +src/archetypes/depth_image.rs linguist-generated=true +src/archetypes/disconnected_space.rs linguist-generated=true +src/archetypes/image.rs linguist-generated=true +src/archetypes/line_strips2d.rs linguist-generated=true +src/archetypes/line_strips3d.rs linguist-generated=true +src/archetypes/mesh3d.rs linguist-generated=true +src/archetypes/mod.rs linguist-generated=true +src/archetypes/pinhole.rs linguist-generated=true +src/archetypes/points2d.rs linguist-generated=true +src/archetypes/points3d.rs linguist-generated=true +src/archetypes/segmentation_image.rs linguist-generated=true +src/archetypes/tensor.rs linguist-generated=true +src/archetypes/text_document.rs linguist-generated=true +src/archetypes/text_log.rs linguist-generated=true +src/archetypes/time_series_scalar.rs linguist-generated=true +src/archetypes/transform3d.rs linguist-generated=true +src/archetypes/view_coordinates.rs linguist-generated=true +src/components/annotation_context.rs linguist-generated=true +src/components/blob.rs linguist-generated=true +src/components/class_id.rs linguist-generated=true +src/components/clear_is_recursive.rs linguist-generated=true +src/components/color.rs linguist-generated=true +src/components/depth_meter.rs linguist-generated=true +src/components/disconnected_space.rs linguist-generated=true +src/components/draw_order.rs linguist-generated=true +src/components/half_sizes2d.rs linguist-generated=true +src/components/half_sizes3d.rs linguist-generated=true +src/components/instance_key.rs linguist-generated=true +src/components/keypoint_id.rs linguist-generated=true +src/components/line_strip2d.rs linguist-generated=true +src/components/line_strip3d.rs linguist-generated=true +src/components/material.rs linguist-generated=true +src/components/media_type.rs linguist-generated=true +src/components/mesh_properties.rs linguist-generated=true +src/components/mod.rs linguist-generated=true +src/components/out_of_tree_transform3d.rs linguist-generated=true +src/components/pinhole_projection.rs linguist-generated=true +src/components/position2d.rs linguist-generated=true +src/components/position3d.rs linguist-generated=true +src/components/radius.rs linguist-generated=true +src/components/resolution.rs linguist-generated=true +src/components/rotation3d.rs linguist-generated=true +src/components/scalar.rs linguist-generated=true +src/components/scalar_scattering.rs linguist-generated=true +src/components/tensor_data.rs linguist-generated=true +src/components/text.rs linguist-generated=true +src/components/text_log_level.rs linguist-generated=true +src/components/transform3d.rs linguist-generated=true +src/components/vector3d.rs linguist-generated=true +src/components/view_coordinates.rs linguist-generated=true +src/datatypes/angle.rs linguist-generated=true +src/datatypes/annotation_info.rs linguist-generated=true +src/datatypes/class_description.rs linguist-generated=true +src/datatypes/class_description_map_elem.rs linguist-generated=true +src/datatypes/class_id.rs linguist-generated=true +src/datatypes/float32.rs linguist-generated=true +src/datatypes/keypoint_id.rs linguist-generated=true +src/datatypes/keypoint_pair.rs linguist-generated=true +src/datatypes/mat3x3.rs linguist-generated=true +src/datatypes/mat4x4.rs linguist-generated=true +src/datatypes/material.rs linguist-generated=true +src/datatypes/mesh_properties.rs linguist-generated=true +src/datatypes/mod.rs linguist-generated=true +src/datatypes/quaternion.rs linguist-generated=true +src/datatypes/rgba32.rs linguist-generated=true +src/datatypes/rotation3d.rs linguist-generated=true +src/datatypes/rotation_axis_angle.rs linguist-generated=true +src/datatypes/scale3d.rs linguist-generated=true +src/datatypes/tensor_buffer.rs linguist-generated=true +src/datatypes/tensor_data.rs linguist-generated=true +src/datatypes/tensor_dimension.rs linguist-generated=true +src/datatypes/transform3d.rs linguist-generated=true +src/datatypes/translation_and_mat3x3.rs linguist-generated=true +src/datatypes/translation_rotation_scale3d.rs linguist-generated=true +src/datatypes/utf8.rs linguist-generated=true +src/datatypes/uvec2d.rs linguist-generated=true +src/datatypes/uvec3d.rs linguist-generated=true +src/datatypes/uvec4d.rs linguist-generated=true +src/datatypes/vec2d.rs linguist-generated=true +src/datatypes/vec3d.rs linguist-generated=true +src/datatypes/vec4d.rs linguist-generated=true +src/testing/archetypes/affix_fuzzer1.rs linguist-generated=true +src/testing/archetypes/affix_fuzzer2.rs linguist-generated=true +src/testing/archetypes/affix_fuzzer3.rs linguist-generated=true +src/testing/archetypes/affix_fuzzer4.rs linguist-generated=true +src/testing/archetypes/mod.rs linguist-generated=true +src/testing/components/affix_fuzzer1.rs linguist-generated=true +src/testing/components/affix_fuzzer10.rs linguist-generated=true +src/testing/components/affix_fuzzer11.rs linguist-generated=true +src/testing/components/affix_fuzzer12.rs linguist-generated=true +src/testing/components/affix_fuzzer13.rs linguist-generated=true +src/testing/components/affix_fuzzer14.rs linguist-generated=true +src/testing/components/affix_fuzzer15.rs linguist-generated=true +src/testing/components/affix_fuzzer16.rs linguist-generated=true +src/testing/components/affix_fuzzer17.rs linguist-generated=true +src/testing/components/affix_fuzzer18.rs linguist-generated=true +src/testing/components/affix_fuzzer19.rs linguist-generated=true +src/testing/components/affix_fuzzer2.rs linguist-generated=true +src/testing/components/affix_fuzzer20.rs linguist-generated=true +src/testing/components/affix_fuzzer21.rs linguist-generated=true +src/testing/components/affix_fuzzer3.rs linguist-generated=true +src/testing/components/affix_fuzzer4.rs linguist-generated=true +src/testing/components/affix_fuzzer5.rs linguist-generated=true +src/testing/components/affix_fuzzer6.rs linguist-generated=true +src/testing/components/affix_fuzzer7.rs linguist-generated=true +src/testing/components/affix_fuzzer8.rs linguist-generated=true +src/testing/components/affix_fuzzer9.rs linguist-generated=true +src/testing/components/mod.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer1.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer2.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer20.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer21.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer3.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer4.rs linguist-generated=true +src/testing/datatypes/affix_fuzzer5.rs linguist-generated=true +src/testing/datatypes/flattened_scalar.rs linguist-generated=true +src/testing/datatypes/mod.rs linguist-generated=true +src/testing/datatypes/primitive_component.rs linguist-generated=true +src/testing/datatypes/string_component.rs linguist-generated=true diff --git a/crates/re_types_core/Cargo.toml b/crates/re_types_core/Cargo.toml new file mode 100644 index 000000000000..24cda58479fa --- /dev/null +++ b/crates/re_types_core/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "re_types_core" +authors.workspace = true +description = "The core traits and types that power Rerun's data model." +edition.workspace = true +homepage.workspace = true +include.workspace = true +license.workspace = true +publish = true +readme = "README.md" +repository.workspace = true +rust-version.workspace = true +version.workspace = true + + +[package.metadata.docs.rs] +all-features = true + + +[features] +default = [] + +## Enable (de)serialization using serde. +serde = ["dep:serde", "re_string_interner/serde"] + + +[dependencies] +# Rerun +re_error.workspace = true +re_string_interner.workspace = true +re_tracing.workspace = true + +# External +anyhow.workspace = true +arrow2 = { workspace = true, features = [ + "io_ipc", + "io_print", + "compute_concatenate", +] } +backtrace.workspace = true +document-features.workspace = true +smallvec.workspace = true +thiserror.workspace = true + +# Optional dependencies +serde = { workspace = true, optional = true } diff --git a/crates/re_types_core/README.md b/crates/re_types_core/README.md new file mode 100644 index 000000000000..102ad6799cc9 --- /dev/null +++ b/crates/re_types_core/README.md @@ -0,0 +1,10 @@ +# re_types_core + +Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates. + +[![Latest version](https://img.shields.io/crates/v/re_types.svg)](https://crates.io/crates/re_types) +[![Documentation](https://docs.rs/re_types/badge.svg)](https://docs.rs/re_types) +![MIT](https://img.shields.io/badge/license-MIT-blue.svg) +![Apache](https://img.shields.io/badge/license-Apache-blue.svg) + +The core traits and types that power Rerun's data model. diff --git a/crates/re_types/src/archetype.rs b/crates/re_types_core/src/archetype.rs similarity index 98% rename from crates/re_types/src/archetype.rs rename to crates/re_types_core/src/archetype.rs index 1db145e82ec0..f0c6a9676c27 100644 --- a/crates/re_types/src/archetype.rs +++ b/crates/re_types_core/src/archetype.rs @@ -15,7 +15,7 @@ use crate::{Component, Loggable, LoggableBatch}; /// layer of abstraction opens opportunities for nicer APIs & tools that wouldn't be possible /// otherwise. /// -/// E.g. consider the [`crate::archetypes::Points3D`] archetype, which represents the set of +/// E.g. consider the `crate::archetypes::Points3D` archetype, which represents the set of /// components to consider when working with a 3D point cloud within Rerun. pub trait Archetype { /// The associated indicator component, whose presence indicates that the high-level @@ -134,7 +134,7 @@ impl ArchetypeName { /// Used for most UI elements. /// /// ``` - /// # use re_types::ArchetypeName; + /// # use re_types_core::ArchetypeName; /// assert_eq!(ArchetypeName::from("rerun.archetypes.Points3D").short_name(), "Points3D"); /// ``` #[inline] diff --git a/crates/re_types/src/arrow_buffer.rs b/crates/re_types_core/src/arrow_buffer.rs similarity index 100% rename from crates/re_types/src/arrow_buffer.rs rename to crates/re_types_core/src/arrow_buffer.rs diff --git a/crates/re_types/src/arrow_string.rs b/crates/re_types_core/src/arrow_string.rs similarity index 100% rename from crates/re_types/src/arrow_string.rs rename to crates/re_types_core/src/arrow_string.rs diff --git a/crates/re_types_core/src/lib.rs b/crates/re_types_core/src/lib.rs new file mode 100644 index 000000000000..1000809a9338 --- /dev/null +++ b/crates/re_types_core/src/lib.rs @@ -0,0 +1,117 @@ +//! The core types and traits that power Rerun's data model. +//! +//! The [`Archetype`] trait is the core of this crate and is a good starting point to get familiar +//! with the code. +//! An archetype is a logical collection of batches of [`Component`]s that play well with each other. +//! +//! Rerun (and the underlying Arrow data framework) is designed to work with large arrays of +//! [`Component`]s, as opposed to single instances. +//! When multiple instances of a [`Component`] are put together in an array, they yield a +//! [`ComponentBatch`]: the atomic unit of (de)serialization. +//! +//! Internally, [`Component`]s are implemented using many different [`Datatype`]s. + +// --- + +/// Describes the interface for interpreting an object as a bundle of [`Component`]s. +/// +/// ## Custom bundles +/// +/// While, in most cases, component bundles are code generated from our [IDL definitions], +/// it is possible to manually extend existing bundles, or even implement fully custom ones. +/// +/// All [`AsComponents`] methods are optional to implement, with the exception of +/// [`AsComponents::as_component_batches`], which describes how the bundle can be interpreted +/// as a set of [`ComponentBatch`]es: arrays of components that are ready to be serialized. +/// +/// Have a look at our [Custom Data] example to learn more about handwritten bundles. +/// +/// [IDL definitions]: https://github.com/rerun-io/rerun/tree/latest/crates/re_types/definitions/rerun +/// [Custom Data]: https://github.com/rerun-io/rerun/blob/latest/examples/rust/custom_data/src/main.rs +pub trait AsComponents { + /// Exposes the object's contents as a set of [`ComponentBatch`]s. + /// + /// This is the main mechanism for easily extending builtin archetypes or even writing + /// fully custom ones. + /// Have a look at our [Custom Data] example to learn more about extending archetypes. + /// + /// [Custom Data]: https://github.com/rerun-io/rerun/blob/latest/examples/rust/custom_data/src/main.rs + // + // NOTE: Don't bother returning a CoW here: we need to dynamically discard optional components + // depending on their presence (or lack thereof) at runtime anyway. + fn as_component_batches(&self) -> Vec>; + + /// The number of instances in each batch. + /// + /// If not implemented, the number of instances will be determined by the longest + /// batch in the bundle. + /// + /// Each batch returned by `as_component_batches` should have this number of elements, + /// or 1 in the case it is a splat, or 0 in the case that component is being cleared. + #[inline] + fn num_instances(&self) -> usize { + self.as_component_batches() + .into_iter() + .map(|comp_batch| comp_batch.as_ref().num_instances()) + .max() + .unwrap_or(0) + } + + // --- + + /// Serializes all non-null [`Component`]s of this bundle into Arrow arrays. + /// + /// The default implementation will simply serialize the result of [`Self::as_component_batches`] + /// as-is, which is what you want in 99.9% of cases. + #[inline] + fn to_arrow( + &self, + ) -> SerializationResult)>> + { + self.as_component_batches() + .into_iter() + .map(|comp_batch| { + comp_batch + .as_ref() + .to_arrow() + .map(|array| (comp_batch.as_ref().arrow_field(), array)) + .with_context(comp_batch.as_ref().name()) + }) + .collect() + } +} + +// --- + +mod archetype; +mod loggable; +mod loggable_batch; +mod result; +mod size_bytes; + +pub use self::archetype::{ + Archetype, ArchetypeName, GenericIndicatorComponent, NamedIndicatorComponent, +}; +pub use self::loggable::{ + Component, ComponentName, ComponentNameSet, Datatype, DatatypeName, Loggable, +}; +pub use self::loggable_batch::{ + ComponentBatch, DatatypeBatch, LoggableBatch, MaybeOwnedComponentBatch, +}; +pub use self::result::{ + DeserializationError, DeserializationResult, ResultExt, SerializationError, + SerializationResult, _Backtrace, +}; +pub use self::size_bytes::SizeBytes; + +// --- + +mod arrow_buffer; +mod arrow_string; +pub use self::arrow_buffer::ArrowBuffer; +pub use self::arrow_string::ArrowString; + +pub mod external { + pub use anyhow; + pub use arrow2; +} diff --git a/crates/re_types/src/loggable.rs b/crates/re_types_core/src/loggable.rs similarity index 99% rename from crates/re_types/src/loggable.rs rename to crates/re_types_core/src/loggable.rs index 43531766787d..1ff08fe5b36e 100644 --- a/crates/re_types/src/loggable.rs +++ b/crates/re_types_core/src/loggable.rs @@ -162,7 +162,7 @@ impl ComponentName { /// Used for most UI elements. /// /// ``` - /// # use re_types::ComponentName; + /// # use re_types_core::ComponentName; /// assert_eq!(ComponentName::from("rerun.components.Position2D").short_name(), "Position2D"); /// ``` #[inline] @@ -221,7 +221,7 @@ impl DatatypeName { /// Used for most UI elements. /// /// ``` - /// # use re_types::DatatypeName; + /// # use re_types_core::DatatypeName; /// assert_eq!(DatatypeName::from("rerun.datatypes.Vec2D").short_name(), "Vec2D"); /// ``` #[inline] diff --git a/crates/re_types/src/loggable_batch.rs b/crates/re_types_core/src/loggable_batch.rs similarity index 100% rename from crates/re_types/src/loggable_batch.rs rename to crates/re_types_core/src/loggable_batch.rs diff --git a/crates/re_types/src/result.rs b/crates/re_types_core/src/result.rs similarity index 100% rename from crates/re_types/src/result.rs rename to crates/re_types_core/src/result.rs diff --git a/crates/re_types/src/size_bytes.rs b/crates/re_types_core/src/size_bytes.rs similarity index 100% rename from crates/re_types/src/size_bytes.rs rename to crates/re_types_core/src/size_bytes.rs diff --git a/crates/re_viewer/Cargo.toml b/crates/re_viewer/Cargo.toml index abd49322f4ac..497b1a7b3812 100644 --- a/crates/re_viewer/Cargo.toml +++ b/crates/re_viewer/Cargo.toml @@ -72,7 +72,6 @@ re_analytics = { workspace = true, optional = true } # External ahash.workspace = true anyhow.workspace = true -arrow2.workspace = true bytemuck.workspace = true cfg-if.workspace = true eframe = { workspace = true, default-features = false, features = [ diff --git a/examples/rust/extend_viewer_ui/src/main.rs b/examples/rust/extend_viewer_ui/src/main.rs index 4e1863aab20c..4743535b6ce6 100644 --- a/examples/rust/extend_viewer_ui/src/main.rs +++ b/examples/rust/extend_viewer_ui/src/main.rs @@ -180,7 +180,7 @@ fn component_ui( } fn format_arrow(value: &dyn arrow2::array::Array) -> String { - use re_log_types::SizeBytes as _; + use re_types::SizeBytes as _; let bytes = value.total_size_bytes(); if bytes < 256 {