]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
1 | // check-pass |
2 | ||
3 | pub struct LookupInternedStorage; | |
4 | ||
5 | impl<Q> QueryStorageOps<Q> for LookupInternedStorage | |
6 | where | |
7 | Q: Query, | |
8 | for<'d> Q: QueryDb<'d>, | |
9 | { | |
10 | fn fmt_index(&self, db: &<Q as QueryDb<'_>>::DynDb) { | |
11 | <<Q as QueryDb<'_>>::DynDb as HasQueryGroup<Q::Group>>::group_storage(db); | |
12 | } | |
13 | } | |
14 | ||
15 | pub trait HasQueryGroup<G> { | |
16 | fn group_storage(&self); | |
17 | } | |
18 | ||
19 | pub trait QueryStorageOps<Q> | |
20 | where | |
21 | Q: Query, | |
22 | { | |
23 | fn fmt_index(&self, db: &<Q as QueryDb<'_>>::DynDb); | |
24 | } | |
25 | ||
26 | pub trait QueryDb<'d> { | |
27 | type DynDb: HasQueryGroup<Self::Group> + 'd; | |
28 | type Group; | |
29 | } | |
30 | ||
31 | pub trait Query: for<'d> QueryDb<'d> {} | |
32 | ||
33 | fn main() {} |