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.
Trait Implementations§
Auto Trait Implementations§
impl<DB> !Freeze for Storage<DB>
impl<DB> RefUnwindSafe for Storage<DB>where
<DB as DatabaseStorageTypes>::DatabaseStorage: RefUnwindSafe,
impl<DB> Send for Storage<DB>
impl<DB> !Sync for Storage<DB>
impl<DB> Unpin for Storage<DB>where
<DB as DatabaseStorageTypes>::DatabaseStorage: Unpin,
impl<DB> UnwindSafe for Storage<DB>where
<DB as DatabaseStorageTypes>::DatabaseStorage: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more