[][src]Attribute Macro hotpatch::patch

#[patch]

Transforms a function into a HotpatchExport capable of being exported and changing the behavior of a function in a seperate binary at runtime. The original function is preserved.

Takes a single optional arguement: modpath. Used to spoof the module path.

Example

#[patch]
fn foo() {}

#[patch(mymod::baz)] // looks like: mod mymod { fn baz() {} }
fn bar() {
  foo(); // can still call foo
}