mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-28 17:42:00 +00:00
daaa78056a
Under this design, *all* databases are a `DatabaseImpl<U>`, where the `U` implements `UserData` (you can use `()` if there is none). Code would default to `&dyn salsa::Database` but if you want to give access to the userdata, you can define a custom database trait `MyDatabase: salsa::Databse` so long as you * annotate `MyDatabase` trait definition of impls of `MyDatabase` with `#[salsa::db]` * implement `MyDatabase` for `DatabaseImpl<U>` where `U` is your userdata (this could be a blanket impl, if you don't know the precise userdata type). The `tests/common/mod.rs` shows the pattern. |
||
---|---|---|
.. | ||
common | ||
compile-fail | ||
parallel | ||
warnings | ||
accumulate-chain.rs | ||
accumulate-custom-clone.rs | ||
accumulate-custom-debug.rs | ||
accumulate-dag.rs | ||
accumulate-execution-order.rs | ||
accumulate-from-tracked-fn.rs | ||
accumulate-no-duplicates.rs | ||
accumulate-reuse-workaround.rs | ||
accumulate-reuse.rs | ||
accumulate.rs | ||
compile_fail.rs | ||
cycles.rs | ||
debug.rs | ||
deletion-cascade.rs | ||
deletion-drops.rs | ||
deletion.rs | ||
elided-lifetime-in-tracked-fn.rs | ||
expect_reuse_field_x_of_a_tracked_struct_changes_but_fn_depends_on_field_y.rs | ||
expect_reuse_field_x_of_an_input_changes_but_fn_depends_on_field_y.rs | ||
hello_world.rs | ||
interned-struct-with-lifetime.rs | ||
is_send_sync.rs | ||
lru.rs | ||
mutate_in_place.rs | ||
override_new_get_set.rs | ||
panic-when-creating-tracked-struct-outside-of-tracked-fn.rs | ||
preverify-struct-with-leaked-data.rs | ||
singleton.rs | ||
specify-only-works-if-the-key-is-created-in-the-current-query.rs | ||
synthetic_write.rs | ||
tracked-struct-id-field-bad-eq.rs | ||
tracked-struct-id-field-bad-hash.rs | ||
tracked-struct-unchanged-in-new-rev.rs | ||
tracked-struct-value-field-bad-eq.rs | ||
tracked-struct-value-field-not-eq.rs | ||
tracked_fn_constant.rs | ||
tracked_fn_no_eq.rs | ||
tracked_fn_on_input.rs | ||
tracked_fn_on_interned.rs | ||
tracked_fn_on_tracked.rs | ||
tracked_fn_on_tracked_specify.rs | ||
tracked_fn_read_own_entity.rs | ||
tracked_fn_read_own_specify.rs | ||
tracked_fn_return_ref.rs | ||
tracked_method.rs | ||
tracked_method_inherent_return_ref.rs | ||
tracked_method_on_tracked_struct.rs | ||
tracked_method_trait_return_ref.rs | ||
tracked_struct_db1_lt.rs | ||
tracked_with_intern.rs | ||
tracked_with_struct_db.rs |