2024-07-19 12:05:39 +00:00
|
|
|
use salsa::Database as Db;
|
2022-09-07 19:09:33 +00:00
|
|
|
|
2024-07-16 10:04:01 +00:00
|
|
|
#[salsa::input]
|
2022-09-07 19:09:33 +00:00
|
|
|
struct MyInput {
|
|
|
|
field: u32,
|
|
|
|
}
|
|
|
|
|
2024-07-19 12:05:39 +00:00
|
|
|
#[salsa::tracked(data = Data)]
|
2022-09-07 19:09:33 +00:00
|
|
|
fn tracked_fn_with_data(db: &dyn Db, input: MyInput) -> u32 {
|
|
|
|
input.field(db) * 2
|
|
|
|
}
|
|
|
|
|
2024-07-19 12:05:39 +00:00
|
|
|
#[salsa::tracked(db = Db)]
|
2022-09-07 19:09:33 +00:00
|
|
|
fn tracked_fn_with_db(db: &dyn Db, input: MyInput) -> u32 {
|
|
|
|
input.field(db) * 2
|
|
|
|
}
|
|
|
|
|
2024-07-19 12:05:39 +00:00
|
|
|
#[salsa::tracked(constructor = TrackedFn3)]
|
2022-09-07 19:09:33 +00:00
|
|
|
fn tracked_fn_with_constructor(db: &dyn Db, input: MyInput) -> u32 {
|
|
|
|
input.field(db) * 2
|
|
|
|
}
|
|
|
|
|
2024-07-16 10:04:01 +00:00
|
|
|
#[salsa::tracked]
|
2024-05-13 09:13:34 +00:00
|
|
|
fn tracked_fn_with_one_input(db: &dyn Db) -> u32 {}
|
2022-09-07 19:09:33 +00:00
|
|
|
|
2024-07-16 10:04:01 +00:00
|
|
|
#[salsa::tracked]
|
2024-05-13 09:13:34 +00:00
|
|
|
fn tracked_fn_with_receiver_not_applied_to_impl_block(&self, db: &dyn Db) -> u32 {}
|
2022-09-07 19:09:33 +00:00
|
|
|
|
2024-07-19 12:05:39 +00:00
|
|
|
#[salsa::tracked(specify)]
|
2024-05-13 09:13:34 +00:00
|
|
|
fn tracked_fn_with_too_many_arguments_for_specify(
|
|
|
|
db: &dyn Db,
|
|
|
|
input: MyInput,
|
|
|
|
input: MyInput,
|
|
|
|
) -> u32 {
|
2022-09-07 19:09:33 +00:00
|
|
|
}
|
|
|
|
|
2024-05-13 09:13:34 +00:00
|
|
|
fn main() {}
|