Skip to main content

register

Macro register 

Source
macro_rules! register {
    ($name:literal, $func:path) => { ... };
}
Expand description

Auto-register a sibling crate’s register fn into the global REGISTRARS slice.

Place at module scope inside the sibling crate, gated behind the crate’s registry cargo feature so the standalone build path stays decoupled from oxideav-core:

pub fn register(ctx: &mut oxideav_core::RuntimeContext) {
    /* install factories */
}

#[cfg(feature = "registry")]
oxideav_core::register!("aac", register);

The macro expands to a #[linkme::distributed_slice] static. The sibling crate must have linkme = "0.3" in its [dependencies] so the absolute path ::linkme::distributed_slice resolves at macro expansion time.