Crate turbo_genesis_macros

Source
Expand description

Turbo Genesis Macros

This module implements the core procedural macros used by Turbo Genesis:

  • #[serialize]: Automatically derive Borsh and Serde traits.
  • #[game]: Generate entry points for hot-reload and release game loops.
  • #[command]: Embed command metadata, derive serialization, and export FFI bindings.
  • #[channel]: Embed channel metadata, derive serialization, and export subscription bindings.
  • #[document]: Derive serialization and implement HasProgramId for document types.

Utilities within include:

  • Argument parsers (CommandArgs, ChannelArgs).
  • Helpers to inline modules and compute project metadata from Cargo.toml.

Attribute Macrosยง

channel
Attribute macro #[channel] for generating client and server bindings on a struct or enum that implements ChannelHandler.
command
Attribute macro #[command] for generating FFI bindings and client helpers on a struct or enum that implements CommandHandler.
document
Attribute macro #[document] for embedding program metadata and deriving serialization on a struct or enum representing a document type.
game
Procedural macro for defining a Turbo game entry point.
serialize
Derive Borsh and Serde serialization for structs and enums.