1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
This trait is used by the blanket implementations of CGP consumer traits to
forward the implementation to the `CgpProvider` type, which impements the
corresponding provider trait.
The `HasCgpProvider` trait is automatically implemented by `#[cgp_context]`
when defining a context type, together with the generated provider struct.
Typically, the `CgpProvider` would contain provider implementation mapping
through `delegate_component!` macro to implement the corresponding provider
traits. However, it is also possible to implement context-specific provider
traits on the `CgpProvider` type directly.
## Example
Given the following context definition:
```rust,ignore
#[cgp_context(MyContextComponents)]
pub struct MyContext {
...
}
```
The following would be generated:
```rust,ignore
pub struct MyContextComponents;
impl HasCgpProvider for MyContext {
type CgpProvider = MyContextComponents;
}
```
*/