Abstract types
An abstract type lets generic code use an associated type while each context chooses its concrete
Checking wiring
Use check traits to verify at compile time that a context's wiring is complete.
Components
A CGP component separates the trait callers use from the trait providers implement.
Error backends
The error backends are three opt-in crates that make one concrete type a context's abstract error:
Extracting CGP compile errors
Use manual error extraction when cargo-cgp is unavailable or leaves a CGP error unrewritten: a
Error handling
CGP gives each context one shared abstract error type and lets it select providers for raising and
Extensible data
Extensible data lets generic code read, build, deconstruct, and convert structs and enums through
Functions and Getters
Use implicit arguments and function macros for routine CGP field access and operations. Getter
Handlers
CGP handlers provide reusable computations selected through wiring. They differ in whether they are
Higher-order providers
A higher-order provider takes another provider as a type parameter and uses it for
Macro grammar and expansion rules
Use this reference to check CGP macro syntax, understand generated code, and interpret compiler
Modern idioms: reading and modernizing CGP
Prefer modern CGP syntax in new code, and keep explicit forms for cases the shorthand cannot
Modularity hierarchy
Choose the least complex form that gives callers the implementation choices they need. CGP supports
Namespaces
A namespace shares component wiring across contexts through a named lookup trait. It can bind common
Type-level primitives
CGP encodes field names, positions, lists, and wiring paths as types so the compiler can resolve
Versions: matching this skill to the project's CGP
Compare the project's versions with this table before you write, change, or debug CGP code in it,
Wiring
Wiring selects the provider for each component on a context. A component separates