salsa - Rust (original) (raw)
Default database implementation that you can use if you don’t require any custom user data.
An integer that uniquely identifies a particular query instance within the database. Used to track input and output dependencies between queries. Fully ordered and equatable but those orderings are arbitrary, and meant to be used only for inserting into maps and the like.
Describes how likely a value is to change—how “durable” it is.
The Event
struct identifies various notable things that can occur during salsa execution. Instances of this struct are given to salsa_event
.
The Id
of a salsa struct in the database Table.
An ingredient index identifies a particular [Ingredient
] in the database.
A unique identifier for the current version of the database.
Concrete implementation of the Database trait with local state that can be used to drive computations.
A handle to non-local database state.
A panic payload indicating that execution of a salsa query was cancelled.
Return value from a cycle recovery function.
An enum identifying the various kinds of events that can occur.
Trait implemented on the struct that user annotated with #[salsa::accumulator]
. The Self
type is therefore the types to be accumulated.
Upcast to a dyn Database
.
The trait implemented by all Salsa databases. You can create your own subtraits of this trait using the #[salsa::db]
(crate::db
) procedural macro.
Used to determine the return type and value for tracked fields and functions annotated with returns(as_deref)
.
Used to determine the return type and value for tracked fields and functions annotated with returns(as_ref)
.
Setter for a field of an input.
Safety
Attach the database to the current thread and execute op
. Panics if a different database has already been attached.
Access the “attached” database. Returns None
if no database is attached. Databases are attached with attach_database
.