cgp_type/traits/has_type.rs
1use cgp_component::{DelegateComponent, IsProviderFor, UseContext, UseDelegate};
2use cgp_macro::cgp_component;
3
4#[cgp_component {
5 provider: TypeProvider,
6 derive_delegate: UseDelegate<Tag>,
7}]
8pub trait HasType<Tag> {
9 type Type;
10}
11
12pub type TypeOf<Context, Tag> = <Context as HasType<Tag>>::Type;