export_plugin

Macro export_plugin 

Source
macro_rules! export_plugin {
    ($plugin_type:ty) => { ... };
}
Expand description

Export a plugin with boilerplate

This macro generates the necessary WASM exports for your plugin.

ยงExample

use mockforge_plugin_sdk::prelude::*;

#[derive(Debug)]
pub struct MyPlugin;

#[async_trait]
impl AuthPlugin for MyPlugin {
    async fn authenticate(&self, context: &PluginContext, credentials: &AuthCredentials) -> PluginResult<AuthResult> {
        Ok(AuthResult::authenticated("user123"))
    }
}

export_plugin!(MyPlugin);