orbis_plugin

Macro orbis_plugin 

Source
macro_rules! orbis_plugin {
    (
        init: $init:expr,
        cleanup: $cleanup:expr $(,)?
    ) => { ... };
    (init: $init:expr $(,)?) => { ... };
    () => { ... };
}
Expand description

Define a complete plugin with minimal boilerplate

§Example

use orbis_plugin_api::prelude::*;

orbis_plugin! {
    init: || {
        log::info!("Plugin starting!");
        state::set("initialized", &true)?;
        Ok(())
    },
    cleanup: || {
        log::info!("Plugin stopping!");
        Ok(())
    }
}