Trait salsa::Database[][src]

pub trait Database: DatabaseOps {
    fn sweep_all(&self, strategy: SweepStrategy) { ... }
fn salsa_event(&self, event_fn: Event) { ... }
fn unwind_if_cancelled(&self) { ... }
fn salsa_runtime(&self) -> &Runtime { ... }
fn salsa_runtime_mut(&mut self) -> &mut Runtime { ... } }
Expand description

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).

Provided methods

fn sweep_all(&self, strategy: SweepStrategy)[src]

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 “main” queries; this will ensure that all query values they consume are marked as used. You then invoke this method to remove other values that were not needed for your main query results.

This method should not be overridden by Database implementors.

fn salsa_event(&self, event_fn: Event)[src]

This function is invoked at key points in the salsa runtime. It permits the database to be customized and to inject logging or other custom behavior.

fn unwind_if_cancelled(&self)[src]

Starts unwinding the stack if the current revision is cancelled.

This method can be called by query implementations that perform potentially expensive computations, in order to speed up propagation of cancellation.

Cancellation will automatically be triggered by salsa on any query invocation.

This method should not be overridden by Database implementors. A salsa_event is emitted when this method is called, so that should be used instead.

fn salsa_runtime(&self) -> &Runtime[src]

Gives access to the underlying salsa runtime.

This method should not be overridden by Database implementors.

fn salsa_runtime_mut(&mut self) -> &mut Runtime[src]

Gives access to the underlying salsa runtime.

This method should not be overridden by Database implementors.

Implementors