Crate cgp_macro

Source
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 both delegate_components! and check_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 of IsProviderFor, also generates a new provider struct based on the Self 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

Derive Macros§

BuildField
ExtractField
FromVariant
HasField
HasFields