Skip to main content

patchable

Attribute Macro patchable 

Source
#[patchable]
Expand description

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
}