Skip to main content

declare_plugin

Macro declare_plugin 

Source
macro_rules! declare_plugin {
    (
        name: $name:expr,
        version: $version:expr,
        description: $desc:expr,
        introspect: $introspect:path $(,)?
    ) => { ... };
}
Expand description

Declare a plugin. Generates the appctl_plugin_register entrypoint plus the introspect / free_string wrappers from a user-provided async function of the form async fn(SyncInput) -> anyhow::Result<Schema>.

use appctl_plugin_sdk::prelude::*;

async fn my_introspect(_input: SyncInput) -> Result<Schema> { todo!() }

declare_plugin! {
    name: "airtable",
    version: "0.1.0",
    description: "Sync an Airtable base",
    introspect: my_introspect,
}