mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-08-04 19:08:32 +00:00
make query_group macro procedural
Switch to a procedural implementation of the `query_group!` macro, residing in the `components/salsa_macros` subcrate. Allow the user to override the invoked function via `salsa::invoke(...)` and the name of the generated query type via `salsa::query_type(...)`. In all tests, replace the `salsa::query_group! { ... }` invocations with the new attribute-style `#[salsa::query_group]` macro, and change them to the new naming scheme for query types (`...Query`). Update README, examples, and documentation.
This commit is contained in:
parent
cd454e986e
commit
93c30a953d
35 changed files with 768 additions and 782 deletions
|
@ -1,10 +1,7 @@
|
|||
salsa::query_group! {
|
||||
trait MyDatabase: salsa::Database {
|
||||
fn my_query(key: ()) -> () {
|
||||
type MyQuery;
|
||||
use fn another_module::another_name;
|
||||
}
|
||||
}
|
||||
#[salsa::query_group]
|
||||
trait MyDatabase: salsa::Database {
|
||||
#[salsa::invoke(another_module::another_name)]
|
||||
fn my_query(&self, key: ()) -> ();
|
||||
}
|
||||
|
||||
mod another_module {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue