Expand description
Yog inter-mod communication — proc-macros for cross-mod function calls.
§Export (manual registration, auto-generated binding symbol)
ⓘ
use yog_api::{yog_export, Registry};
#[yog_export]
pub fn register_pipe(api: *const yog_api::YogApi, json: *const std::ffi::c_char) {
// ...
}
fn register(registry: &mut Registry) {
// Manual export registration (loader scanning coming later)
registry.interop().export("register_pipe", register_pipe as *const std::ffi::c_void);
}§Import (auto-wired by loader)
ⓘ
yog_api::import! {
from "yog-pipes" {
fn register_pipe(api: *const yog_api::YogApi, json: *const std::ffi::c_char);
}
}
// Use like a normal function — loader wires it at init time
register_pipe(api, json_ptr);Macros§
- import
- Declare imported functions from another mod. Generates public wrapper
functions and
__yog_bind_NAMEentry points for the loader.
Attribute Macros§
- yog_
export - Marks a function for inter-mod export.