diff --git a/src/database.rs b/src/database.rs index 52f74e65..55a2b6d6 100644 --- a/src/database.rs +++ b/src/database.rs @@ -1,6 +1,10 @@ use std::{any::Any, panic::RefUnwindSafe}; -use crate::{self as salsa, local_state, storage::Zalsa, Durability, Event, Revision, Storage}; +use crate::{ + self as salsa, local_state, + storage::{Zalsa, ZalsaImpl}, + Durability, Event, Revision, +}; /// The trait implemented by all Salsa databases. /// You can create your own subtraits of this trait using the `#[salsa::db]` procedural macro. @@ -98,7 +102,7 @@ impl dyn Database { /// Concrete implementation of the [`Database`][] trait. /// Takes an optional type parameter `U` that allows you to thread your own data. pub struct DatabaseImpl { - storage: Storage, + storage: ZalsaImpl, } impl Default for DatabaseImpl { @@ -113,7 +117,7 @@ impl DatabaseImpl<()> { /// You can also use the [`Default`][] trait if your userdata implements it. pub fn new() -> Self { Self { - storage: Storage::with(()), + storage: ZalsaImpl::with(()), } } } @@ -124,7 +128,7 @@ impl DatabaseImpl { /// You can also use the [`Default`][] trait if your userdata implements it. pub fn with(u: U) -> Self { Self { - storage: Storage::with(u), + storage: ZalsaImpl::with(u), } } } diff --git a/src/lib.rs b/src/lib.rs index 7b38a291..098cd9d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,6 @@ pub use self::input::setter::Setter; pub use self::key::DatabaseKeyIndex; pub use self::revision::Revision; pub use self::runtime::Runtime; -pub use self::storage::Storage; pub use self::update::Update; pub use crate::local_state::with_attached_database; pub use salsa_macros::accumulator; @@ -89,7 +88,6 @@ pub mod plumbing { pub use crate::storage::views; pub use crate::storage::IngredientCache; pub use crate::storage::IngredientIndex; - pub use crate::storage::Storage; pub use crate::storage::Zalsa; pub use crate::tracked_struct::TrackedStructInDb; pub use crate::update::always_update; diff --git a/src/storage.rs b/src/storage.rs index f05c22f8..43ac7670 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -72,7 +72,7 @@ pub trait Zalsa { fn report_tracked_write(&mut self, durability: Durability); } -impl Zalsa for Storage { +impl Zalsa for ZalsaImpl { fn views(&self) -> &Views { &self.views_of } @@ -212,7 +212,7 @@ impl IngredientIndex { /// The "storage" struct stores all the data for the jars. /// It is shared between the main database and any active snapshots. -pub struct Storage { +pub(crate) struct ZalsaImpl { user_data: U, views_of: ViewsOf>, @@ -241,14 +241,14 @@ pub struct Storage { } // ANCHOR: default -impl Default for Storage { +impl Default for ZalsaImpl { fn default() -> Self { Self::with(Default::default()) } } // ANCHOR_END: default -impl Storage { +impl ZalsaImpl { pub(crate) fn with(user_data: U) -> Self { Self { views_of: Default::default(),