Attribute Macro panda_macros::init

source ·
#[init]
Expand description

(Required Callback) Called when the plugin is being uninitialized

Example

use panda::PluginHandle;

#[panda::init]
fn start(_: &mut PluginHandle) {
    println!("Plugin started up!");
}

Allowed Return Types

  • (): plugin load always succeeds
  • bool: plugin load is aborted if false is returned
  • Result<T, E>: plugin load is aborted on Err, prints the error beforehand
  • i32: plugin load succeeds if 0 is returned, otherwise abort