Crate webarcade_api

Crate webarcade_api 

Source
Expand description

§WebArcade Plugin API (Lightweight)

Minimal API for building WebArcade plugins with fast compile times. This crate provides only what’s needed for FFI plugin communication.

§Features

  • bridge - Enable HTTP bridge functionality (tokio, http types). Only needed for plugins that define routes in their Cargo.toml.

§Quick Start

use api::prelude::*;

pub struct MyPlugin;

impl Plugin for MyPlugin {
    fn metadata(&self) -> PluginMetadata {
        PluginMetadata {
            id: "my-plugin".into(),
            name: "My Plugin".into(),
            version: "1.0.0".into(),
            description: "A plugin".into(),
            author: "You".into(),
            dependencies: vec![],
        }
    }
}

Re-exports§

pub use plugin::Plugin;
pub use plugin::PluginMetadata;
pub use serde_json;
pub use log;

Modules§

plugin
Plugin trait and metadata definitions
prelude

Macros§

json
Construct a serde_json::Value from a JSON literal.

Enums§

Value
Represents any valid JSON value.

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
Serialize
A data structure that can be serialized into any data format supported by Serde.

Derive Macros§

Deserialize
Serialize