Expand description
This crate provides the proc macros used for defining CGP components.
Macros§
- Product
- The
Product!
macro is used to define a type-level list of types, a.k.a. a product type. - Sum
- The
Sum!
macro is used to define a sum type, with the given list of types as disjoint variants. - cgp_
preset - CGP presets are made of extensible collection of key/value mappings, that can be inherited to form new mappings.
- check_
components - The
check_components!
macro allows users to write compile-time tests to check for the correctness of component wiring for a CGP context. - delegate_
and_ check_ components - The
delegate_and_check_components!
macro combines bothdelegate_components!
andcheck_components!
, allowing both delegation and checks within a single macro call. - delegate_
components - The
delegate_components!
macro is used to define wiring of CGP components on a provider type. - product
- replace_
with - symbol
- The
symbol!
macro is used to create a type-level string through the string literal given to the macro.
Attribute Macros§
- blanket_
trait - The
#[blanket_trait]
macro can be used to define trait aliases that contain empty body and trivial blanket implementations. - cgp_
auto_ getter #[cgp_auto_getter]
is used on a regular getter Rust trait without turnning it into a CGP component. Instead, a blanket implementation is derived directly on that trait.- cgp_
component #[cgp_component]
is the most basic macro used to define a CGP component.- cgp_
computer - cgp_
context - The
#[cgp_context]
macro is used when defining a CGP context. - cgp_
getter #[cgp_getter]
is an extension to#[cgp_component]
that derives additional getter constructs.- cgp_
handler - cgp_
new_ provider - The
#[cgp_new_provider]
macro is an extension to#[cgp_provider]
that in addition to the derivation ofIsProviderFor
, also generates a new provider struct based on theSelf
type. - cgp_
producer - cgp_
provider #[cgp_provider]
is used when implementing a provider trait.- cgp_
type #[cgp_type]
is an extension to#[cgp_component]
that derives additional constructs for abstract type components.- re_
export_ imports