Skip to main content

hotpatch_module

Macro hotpatch_module 

Source
macro_rules! hotpatch_module {
    ($module_name:literal, $module_version:expr, [$(($symbol:literal, $func:path)),+ $(,)?]) => { ... };
    (@count $(($symbol:literal, $func:path)),+) => { ... };
    (@replace $symbol:literal $func:path) => { ... };
}
Expand description

Export a patch module manifest with a stable C ABI.

This macro is intended for cdylib patch crates.

Example:

use hotpatch_rs::{hotpatch_module, PatchFn};

unsafe extern "C" fn handler(state: *mut core::ffi::c_void, input: *const core::ffi::c_void, output: *mut core::ffi::c_void) -> i32 {
    0
}

hotpatch_module!("counter", 1, [("counter.add", handler)]);