Skip to main content

Crate goud_engine_macros

Crate goud_engine_macros 

Source
Expand description

§GoudEngine Proc-Macro Crate

Provides the #[goud_api] attribute macro for auto-generating FFI wrappers from annotated impl blocks. This eliminates the need to hand-write boilerplate FFI functions for each SDK method.

§Usage

#[goud_api(module = "window")]
impl GoudGame {
    pub fn should_close(&self) -> bool { ... }
    pub fn poll_events(&mut self) -> GoudResult<f32> { ... }
}

This generates:

  • goud_window_should_close(ctx: GoudContextId) -> bool
  • goud_window_poll_events(ctx: GoudContextId, out: *mut f32) -> GoudResult

§Attributes

  • #[goud_api(module = "name")] - Required. Sets the module prefix.
  • #[goud_api(module = "name", feature = "native")] - Optional feature gate.
  • #[goud_api(skip)] on a method - Excludes it from FFI generation.
  • #[goud_api(name = "custom")] on a method - Overrides the FFI name portion.

Attribute Macros§

goud_api
The #[goud_api] attribute macro for auto-generating FFI wrappers.