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
38
39
40
41
42
43
44
use PhantomData;
use WithProvider;
use cgp_provider;
use crateTypeProviderComponent;
use crateTypeProvider;
/**
The `UseType` pattern is used to implement a CGP abstract type with the
specified `Type`.
When a CGP type component is defined using the `#[cgp_type]` macro, a
provider implementation of `UseType` is automatically generated.
With `UseType`, users can instantiate an abstract type with the specified
`Type` without having to manually implement the given provider trait.
## Example
Given the following type component definition:
```rust,ignore
#[cgp_type]
pub trait HasNameType {
type Name;
}
```
The following `UseType` implementation would be generated:
```rust,ignore
impl<Context, Type> NameTypeProvider<Context> for UseType<Type> {
type Name = Type;
}
```
*/
;
pub type WithType<Type> = ;