pub struct Storage<DB: DatabaseStorageTypes> { /* private fields */ }
Expand description
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<Self>
field.
Implementations§
Source§impl<DB: DatabaseStorageTypes> Storage<DB>
impl<DB: DatabaseStorageTypes> Storage<DB>
Sourcepub fn salsa_runtime(&self) -> &Runtime
pub fn salsa_runtime(&self) -> &Runtime
Gives access to the underlying salsa runtime.
Sourcepub fn salsa_runtime_mut(&mut self) -> &mut Runtime
pub fn salsa_runtime_mut(&mut self) -> &mut Runtime
Gives access to the underlying salsa runtime.
Sourcepub fn query_store(&self) -> &DB::DatabaseStorage
pub fn query_store(&self) -> &DB::DatabaseStorage
Access the query storage tables. Not meant to be used directly by end users.
Sourcepub fn query_store_mut(&mut self) -> (&DB::DatabaseStorage, &mut Runtime)
pub fn query_store_mut(&mut self) -> (&DB::DatabaseStorage, &mut Runtime)
Access the query storage tables. Not meant to be used directly by end users.
Sourcepub fn snapshot(&self) -> Self
pub fn snapshot(&self) -> Self
Returns a “snapshotted” storage, suitable for use in a forked database.
This snapshot hold a read-lock on the global state, which means that any
attempt to set
an input will block until the forked runtime is
dropped. See ParallelDatabase::snapshot
for more information.
Warning. This second handle is intended to be used from a separate thread. Using two database handles from the same thread can lead to deadlock.