pub struct Runtime { /* private fields */ }
Expand description
The salsa runtime stores the storage for all queries as well as tracking the query stack and dependencies between cycles.
Each new runtime you create (e.g., via Runtime::new
or
Runtime::default
) will have an independent set of query storage
associated with it. Normally, therefore, you only do this once, at
the start of your application.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new runtime; equivalent to Self::default
. This is
used when creating a new database.
Sourcepub fn synthetic_write(&mut self, durability: Durability)
pub fn synthetic_write(&mut self, durability: Durability)
A “synthetic write” causes the system to act as though some
input of durability durability
has changed. This is mostly
useful for profiling scenarios.
WARNING: Just like an ordinary write, this method triggers cancellation. If you invoke it while a snapshot exists, it will block until that snapshot is dropped – if that snapshot is owned by the current thread, this could trigger deadlock.
Sourcepub fn id(&self) -> RuntimeId
pub fn id(&self) -> RuntimeId
The unique identifier attached to this SalsaRuntime
. Each
snapshotted runtime has a distinct identifier.
Sourcepub fn active_query(&self) -> Option<DatabaseKeyIndex>
pub fn active_query(&self) -> Option<DatabaseKeyIndex>
Returns the database-key for the query that this thread is actively executing (if any).
Sourcepub fn report_untracked_read(&self)
pub fn report_untracked_read(&self)
Reports that the query depends on some state unknown to salsa.
Queries which report untracked reads will be re-executed in the next revision.
Sourcepub fn report_synthetic_read(&self, durability: Durability)
pub fn report_synthetic_read(&self, durability: Durability)
Acts as though the current query had read an input with the given durability; this will force the current query’s durability to be at most durability
.
This is mostly useful to control the durability level for on-demand inputs.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl !Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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