| Crates.io | webarcade-api |
| lib.rs | webarcade-api |
| version | 0.1.1 |
| created_at | 2025-12-10 18:54:41.983883+00 |
| updated_at | 2025-12-13 15:42:30.584131+00 |
| description | Plugin API for WebArcade - Build native desktop plugins with Rust |
| homepage | https://github.com/warcade/core |
| repository | https://github.com/warcade/api |
| max_upload_size | |
| id | 1978605 |
| size | 27,342 |
Plugin API for WebArcade - Build native desktop plugins with Rust.
[dependencies]
webarcade-api = "0.1"
# Enable bridge feature for HTTP route handlers
webarcade-api = { version = "0.1", features = ["bridge"] }
use api::{Plugin, PluginMetadata};
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 WebArcade plugin".into(),
author: "You".into(),
dependencies: vec![],
}
}
}
Enable the bridge feature to create HTTP route handlers:
use api::{HttpRequest, HttpResponse, json, json_response};
pub async fn handle_hello(_req: HttpRequest) -> HttpResponse {
json_response(&json!({
"message": "Hello from Rust!"
}))
}
Define routes in your plugin's Cargo.toml:
[routes]
"GET /hello" = "handle_hello"
"POST /data" = "handle_data"
bridge - Enable HTTP bridge functionality (tokio runtime, HTTP types). Only needed for plugins that define routes.MIT