macro_rules! declare_node_app {
($app_type:ty) => { ... };
}Expand description
Generate all FFI boilerplate for a NodeApp implementation.
This macro creates:
- A
OnceLock<Mutex<T>>instance for the app (sound concurrent access). - The
_node_app_entryexport symbol returning aNodeAppVTable. - FFI wrapper functions for
init,shutdown,handle_request,handle_event,handle_capability, andfree. catch_unwindguards on every FFI boundary to prevent UB from panics crossing the Rust/C ABI.- Thread-local trace span management around
handle_capability.
Invoke once at the crate root after defining the app type:
ⓘ
declare_node_app!(MyApp);