Skip to main content

Crate webylib_macros

Crate webylib_macros 

Source
Expand description

Procedural macros for webylib.

Three macros land here:

  • #[wallet_op] — generates lock/run-effect/emit-event/persist plumbing for a wallet operation. Mirrors webycash-server’s #[gen_server].
  • #[asset_storage] — generates per-asset CRUD on the Store trait from a struct definition.
  • #[ffi_export] — generates the extern "C" shim, error-code marshaling, opaque-handle lifecycle, and async-callback bridging for the FFI layer. This is the macro that replaces the legacy 22K-LOC handwritten src/ffi/wallet_ops.rs with one source of truth.

Attribute Macros§

asset_storage
#[asset_storage] — placeholder that re-emits the input unchanged. Generates per-asset CRUD on the Store trait when populated.
ffi_export
Attribute macro that takes an async (or sync) Rust function and emits a matching extern "C" shim.
wallet_op
#[wallet_op] — placeholder that re-emits the input unchanged. Real plumbing (lock/run/persist) lands when webylib-core operations migrate from webylib/src/wallet/operations.rs.