Skip to content

Commit f5f80f9

Browse files
authored
Move StoreBundle from re_viewer_context to re_entity_db (#9971)
Title. Small refactor to make my life easier.
1 parent 423eac0 commit f5f80f9

File tree

9 files changed

+11
-16
lines changed

9 files changed

+11
-16
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8123,15 +8123,13 @@ dependencies = [
81238123
"once_cell",
81248124
"parking_lot",
81258125
"pollster 0.4.0",
8126-
"re_build_info",
81278126
"re_capabilities",
81288127
"re_chunk",
81298128
"re_chunk_store",
81308129
"re_data_source",
81318130
"re_entity_db",
81328131
"re_format",
81338132
"re_log",
8134-
"re_log_encoding",
81358133
"re_log_types",
81368134
"re_math",
81378135
"re_query",

crates/store/re_entity_db/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
pub mod entity_db;
88
pub mod entity_tree;
99
mod instance_path;
10+
mod store_bundle;
1011
mod time_histogram_per_timeline;
1112
mod times_per_timeline;
1213
mod versioned_instance_path;
@@ -15,6 +16,7 @@ pub use self::{
1516
entity_db::{DEFAULT_GC_TIME_BUDGET, EntityDb},
1617
entity_tree::EntityTree,
1718
instance_path::{InstancePath, InstancePathHash},
19+
store_bundle::{StoreBundle, StoreLoadError},
1820
time_histogram_per_timeline::{TimeHistogram, TimeHistogramPerTimeline},
1921
times_per_timeline::{TimeCounts, TimesPerTimeline},
2022
versioned_instance_path::{VersionedInstancePath, VersionedInstancePathHash},

crates/viewer/re_viewer_context/src/store_bundle.rs renamed to crates/store/re_entity_db/src/store_bundle.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
use itertools::Itertools as _;
22

3-
use re_entity_db::EntityDb;
43
use re_log_types::{StoreId, StoreKind};
54

5+
use crate::EntityDb;
6+
67
#[derive(thiserror::Error, Debug)]
78
pub enum StoreLoadError {
89
#[error(transparent)]
910
Decode(#[from] re_log_encoding::decoder::DecodeError),
1011

1112
#[error(transparent)]
12-
ChunkStore(#[from] re_entity_db::Error),
13+
ChunkStore(#[from] crate::Error),
1314
}
1415

1516
/// Stores many [`EntityDb`]s of recordings and blueprints.

crates/viewer/re_viewer/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,7 @@ fn blueprint_loader() -> BlueprintPersistence {
19631963

19641964
#[cfg(not(target_arch = "wasm32"))]
19651965
fn blueprint_loader() -> BlueprintPersistence {
1966-
use re_viewer_context::StoreBundle;
1966+
use re_entity_db::StoreBundle;
19671967

19681968
fn load_blueprint_from_disk(app_id: &ApplicationId) -> anyhow::Result<Option<StoreBundle>> {
19691969
let blueprint_path = crate::saving::default_blueprint_path(app_id)?;

crates/viewer/re_viewer/src/loading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use re_viewer_context::{StoreBundle, StoreLoadError};
1+
use re_entity_db::{StoreBundle, StoreLoadError};
22

33
#[derive(thiserror::Error, Debug)]
44
enum BlueprintLoadError {

crates/viewer/re_viewer_context/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,12 @@ ignored = ["home"]
2626
testing = ["dep:pollster", "dep:egui_kittest"]
2727

2828
[dependencies]
29-
re_build_info.workspace = true
3029
re_capabilities.workspace = true
3130
re_chunk_store.workspace = true
3231
re_chunk.workspace = true
3332
re_data_source.workspace = true
3433
re_entity_db = { workspace = true, features = ["serde"] }
3534
re_format.workspace = true
36-
re_log_encoding.workspace = true
3735
re_log_types.workspace = true
3836
re_log.workspace = true
3937
re_math.workspace = true

crates/viewer/re_viewer_context/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ mod query_context;
1919
mod query_range;
2020
mod selection_state;
2121
mod storage_context;
22-
mod store_bundle;
2322
mod store_context;
2423
pub mod store_hub;
2524
mod tables;
@@ -67,7 +66,6 @@ pub use self::{
6766
ItemContext, SelectionChange, SelectionHighlight,
6867
},
6968
storage_context::StorageContext,
70-
store_bundle::{StoreBundle, StoreLoadError},
7169
store_context::StoreContext,
7270
store_hub::{StoreHub, StoreHubEntry},
7371
tables::{TableStore, TableStores},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::{StoreBundle, StoreHub, TableStores};
1+
use crate::{StoreHub, TableStores};
22

33
/// Provides read-only references over the different kinds of storage used throughout the viewer.
44
pub struct StorageContext<'a> {
55
pub hub: &'a StoreHub,
6-
pub bundle: &'a StoreBundle,
6+
pub bundle: &'a re_entity_db::StoreBundle,
77
pub tables: &'a TableStores,
88
}

crates/viewer/re_viewer_context/src/store_hub.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ use re_chunk_store::{
88
ChunkStoreConfig, ChunkStoreGeneration, ChunkStoreStats, GarbageCollectionOptions,
99
GarbageCollectionTarget,
1010
};
11-
use re_entity_db::EntityDb;
11+
use re_entity_db::{EntityDb, StoreBundle};
1212
use re_log_types::{ApplicationId, ResolvedTimeRange, StoreId, StoreKind, TableId};
1313
use re_query::CachesStats;
1414
use re_types::{archetypes, components::Timestamp};
1515

16-
use crate::{
17-
BlueprintUndoState, Caches, StorageContext, StoreBundle, StoreContext, TableStore, TableStores,
18-
};
16+
use crate::{BlueprintUndoState, Caches, StorageContext, StoreContext, TableStore, TableStores};
1917

2018
#[derive(Clone, Debug)]
2119
pub enum StoreHubEntry {

0 commit comments

Comments
 (0)