Skip to main content

register

Macro register 

Source
macro_rules! register {
    ( $($rest:tt)* ) => { ... };
}
Expand description

生成 plugin_alloc / plugin_free / plugin_dispatch 三个 ABI 导出(spec §6.1/§6.2)。 可挂载(任意顺序、可组合):

  • before_savefn(Note) -> Result<Note, String>
  • storage:impl storage::Storage 的类型
  • commandfn(&str /* 命令 id */, Value /* args */) -> Result<Value, PluginError>