diff --git a/src/lib.rs b/src/lib.rs index 035c7698..302461a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,7 @@ pub use crate::storage::Storage; /// The base trait which your "query context" must implement. Gives /// access to the salsa runtime, which you must embed into your query /// context (along with whatever other state you may require). -pub trait Database: plumbing::DatabaseStorageTypes + plumbing::DatabaseOps { +pub trait Database: plumbing::DatabaseOps { /// Iterates through all query storage and removes any values that /// have not been used since the last revision was created. The /// intended use-cycle is that you first execute all of your diff --git a/src/plumbing.rs b/src/plumbing.rs index 77bea3f4..1106f68d 100644 --- a/src/plumbing.rs +++ b/src/plumbing.rs @@ -29,7 +29,7 @@ pub struct CycleDetected { /// should be generated for your query-context type automatically by /// the `database_storage` macro, so you shouldn't need to mess /// with this trait directly. -pub trait DatabaseStorageTypes: Sized { +pub trait DatabaseStorageTypes: Database { /// Defines the "storage type", where all the query data is kept. /// This type is defined by the `database_storage` macro. type DatabaseStorage: Default; diff --git a/src/storage.rs b/src/storage.rs index a2c01b24..d21a4c20 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,16 +1,16 @@ -use crate::{Database, Runtime}; +use crate::{plumbing::DatabaseStorageTypes, Runtime}; use std::sync::Arc; /// Stores the cached results and dependency information for all the queries /// defined on your salsa database. Also embeds a [`Runtime`] which is used to /// manage query execution. Every database must include a `storage: /// Storage` field. -pub struct Storage { +pub struct Storage { query_store: Arc, runtime: Runtime, } -impl Default for Storage { +impl Default for Storage { fn default() -> Self { Self { query_store: Default::default(), @@ -19,7 +19,7 @@ impl Default for Storage { } } -impl Storage { +impl Storage { /// Gives access to the underlying salsa runtime. pub fn salsa_runtime(&self) -> &Runtime { &self.runtime