pub struct RidlDatabase { /* private fields */ }Expand description
The concrete salsa database ridlc and the language server run on.
A salsa event callback records the database_key of every tracked-query
execution, so a test can assert not only how many queries re-ran after an
edit but exactly which ones (issue #102). The log is read and reset with
RidlDatabase::take_executed_queries. The database deliberately does not
implement Clone: a clone sharing the execution log would make the
observability counters ambiguous (issue #102).
Implementations§
Source§impl RidlDatabase
impl RidlDatabase
Sourcepub fn take_executed_queries(&self) -> Vec<DatabaseKeyIndex>
pub fn take_executed_queries(&self) -> Vec<DatabaseKeyIndex>
Returns the database_key of every tracked-query execution since the
previous call, in execution order, and clears the log.
Trait Implementations§
Source§impl Database for RidlDatabase
impl Database for RidlDatabase
Source§fn trigger_lru_eviction(&mut self)
fn trigger_lru_eviction(&mut self)
Enforces current LRU limits, evicting entries if necessary. Read more
Source§fn synthetic_write(&mut self, durability: Durability)
fn synthetic_write(&mut self, durability: Durability)
A “synthetic write” causes the system to act as though some
input of durability
durability has changed, triggering a new revision.
This is mostly useful for profiling scenarios. Read moreSource§fn trigger_cancellation(&mut self)
fn trigger_cancellation(&mut self)
This method cancels all outstanding computations.
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.
Source§fn cancellation_token(&self) -> CancellationToken
fn cancellation_token(&self) -> CancellationToken
Retrieves a
CancellationToken for the current database handle.Source§fn report_untracked_read(&self)
fn report_untracked_read(&self)
Reports that the query depends on some state unknown to salsa. Read more
Source§fn ingredient_debug_name(
&self,
ingredient_index: IngredientIndex,
) -> Cow<'_, str>
fn ingredient_debug_name( &self, ingredient_index: IngredientIndex, ) -> Cow<'_, str>
Return the “debug name” (i.e., the struct name, etc) for an “ingredient”,
which are the fine-grained components we use to track data. This is intended
for debugging and the contents of the returned string are not semver-guaranteed. Read more
Source§fn unwind_if_revision_cancelled(&self)
fn unwind_if_revision_cancelled(&self)
Starts unwinding the stack if the current revision is cancelled. Read more
Source§impl Default for RidlDatabase
impl Default for RidlDatabase
Auto Trait Implementations§
impl !Freeze for RidlDatabase
impl !Sync for RidlDatabase
impl !UnwindSafe for RidlDatabase
impl RefUnwindSafe for RidlDatabase
impl Send for RidlDatabase
impl Unpin for RidlDatabase
impl UnsafeUnpin for RidlDatabase
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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