Attribute Macro hotpatch::patchable[][src]

#[patchable]

Transforms a function into a Patchable capable of having its behavior redefined at runtime.

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

Example

#[patchable]
fn foo() {}

#[patchable(mymod::baz)] // will look for the function ::mymod::baz instead of ::bar
fn bar() {
  foo(); // foo is callable, just as a functor
}