The type generator macro

Request and response types make up the majority of cuprate-rpc-types.

  • Request types are the inputs expected from users
  • Response types are what will be outputted to users

Regardless of being meant for JSON-RPC, binary, or a standalone JSON endpoint, all request/response types are defined using the "type generator macro". This macro is important because it defines all request/response types.

This macro:

  • Defines a matching pair of request & response types
  • Implements many derive traits, e.g. Clone on those types
  • Implements both serde and epee on those types
  • Automates documentation, tests, etc.

See here for example usage of this macro.

Last change: 2024-11-18, commit: e8598a0