cgp-type 0.7.0

Context-generic programming core component traits
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use cgp_component::{DelegateComponent, IsProviderFor, UseContext, UseDelegate};
use cgp_macro::cgp_component;

#[cgp_component {
    provider: TypeProvider,
    derive_delegate: UseDelegate<Tag>,
}]
pub trait HasType<Tag> {
    type Type;
}

pub type TypeOf<Context, Tag> = <Context as HasType<Tag>>::Type;