wplug/src/plugin.rs
Andrey Tkachenko 47f8b48407
All checks were successful
continuous-integration/drone/push Build is passing
PMS Basic Update
2022-03-29 10:57:28 +04:00

44 lines
847 B
Rust

use std::{collections::HashMap, sync::Arc};
use toml::Value;
use crate::{metadata::PluginMetadata, Error};
pub struct PluginApiInfo {}
pub struct PluginInfo {
pub api: PluginApiInfo,
pub options: HashMap<String, Value>,
}
pub struct Plugin {
metadata: Arc<PluginMetadata>,
}
impl Plugin {
pub fn metadata(&self) -> Result<PluginMetadata, Error> {
unimplemented!()
}
pub fn enumerate_callables(&self) -> impl Iterator<Item = ()> {
vec![].into_iter()
}
// Plugin API
pub async fn initialize(&mut self) -> Result<(), Error> {
unimplemented!()
}
pub async fn destroy(&mut self) {}
pub async fn handle(&self, cmd_id: String, args: Vec<Value>) -> Result<Value, Error> {
unimplemented!()
}
}
pub struct PluginCall {
name: String,
args: Vec<Value>,
}