The cgp
project contains a collection of micro Rust crates that empowers
context-generic programming (CGP), a new programming paradigm in Rust.
To learn more about context-generic programming, check out the book
Context-Generic Programming Patterns.
The CGP core constructs are organized as many child crates that are intended to be minimal and stable. Having each construct defined in separate crate helps us avoid introducing breaking changes in semantic versioning, in case an unrelated construct is updated.
We also offers meta-crates that aggregate the dependencies from many CGP child crates into one place, so that users can use CGP by specifying only one dependency:
cgp
- The main crate that includes all child crates defined in this project.cgp-core
- Meta crate that includes core CGP crates thatcgp-extra
- Meta crate that includes additional CGP crates that may be non-essential or unstable.
The following library crates are provided:
cgp-component
- Defines the core CGP component traits and macros.cgp-async
- Defines theAsync
trait as an alias for async-safe types.cgp-error
- Defines theHasErrorType
component and error handling constructs.cgp-field
- Defines theHasField
trait to enable the use of data-generic programming with CGP.cgp-inner
- Defines theHasInner
component which enables composition-based implementation in CGP.cgp-run
- Defines theCanRun
component for implementing async runners.