Expand description
This crate defines the core CGP types and traits used to enable the core CGP component implementation.
Structs§
- UseContext
- The
UseContext
pattern is used to define a trivial implementation of a provider trait, by forwarding the implementation to the consumer trait implementation of the context. - UseDelegate
- The
UseDelegate
pattern is used as the default dispatcher for CGP components that contain additional generic parameters in their traits. - UseFields
- With
Provider
Traits§
- CanUse
Component - This is a convenient type alias that is used in the same way as
IsProviderFor
, but with theSelf
type being theContext
type rather than theProvider
type that implements the provider trait. - Delegate
Component - This is the core trait used by the
delegate_component!
macro to define a mapping fromName
toDelegate
on the targetSelf
type. - HasCgp
Provider - 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. - IsProvider
For - The
IsProviderFor
trait is used to propagate the constraints required to implement the provider trait that corresponds to theComponent
type.