mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-24 12:16:25 +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. |
||
---|---|---|
.. | ||
accumulator_incompatibles.rs | ||
accumulator_incompatibles.stderr | ||
get-on-private-interned-field.rs | ||
get-on-private-interned-field.stderr | ||
get-on-private-tracked-field.rs | ||
get-on-private-tracked-field.stderr | ||
get-set-on-private-input-field.rs | ||
get-set-on-private-input-field.stderr | ||
input_struct_incompatibles.rs | ||
input_struct_incompatibles.stderr | ||
interned_struct_incompatibles.rs | ||
interned_struct_incompatibles.stderr | ||
lru_can_not_be_used_with_specify.rs | ||
lru_can_not_be_used_with_specify.stderr | ||
panic-when-reading-fields-of-tracked-structs-from-older-revisions.rs | ||
panic-when-reading-fields-of-tracked-structs-from-older-revisions.stderr | ||
salsa_fields_incompatibles.rs | ||
salsa_fields_incompatibles.stderr | ||
singleton_only_for_input.rs | ||
singleton_only_for_input.stderr | ||
span-input-setter.rs | ||
span-input-setter.stderr | ||
span-tracked-getter.rs | ||
span-tracked-getter.stderr | ||
specify-does-not-work-if-the-key-is-a-salsa-input.rs | ||
specify-does-not-work-if-the-key-is-a-salsa-input.stderr | ||
specify-does-not-work-if-the-key-is-a-salsa-interned.rs | ||
specify-does-not-work-if-the-key-is-a-salsa-interned.stderr | ||
tracked_fn_incompatibles.rs | ||
tracked_fn_incompatibles.stderr | ||
tracked_impl_incompatibles.rs | ||
tracked_impl_incompatibles.stderr | ||
tracked_method_incompatibles.rs | ||
tracked_method_incompatibles.stderr | ||
tracked_method_on_untracked_impl.rs | ||
tracked_method_on_untracked_impl.stderr | ||
tracked_struct_incompatibles.rs | ||
tracked_struct_incompatibles.stderr |