Small plugin structure fix

This commit is contained in:
2025-12-11 23:25:08 +01:00
parent 4d6c69772b
commit cc620511a9
3 changed files with 23 additions and 18 deletions
+8 -17
View File
@@ -1,9 +1,14 @@
use crate::{logger, plugin::Plugin};
use serde::{Deserialize, Serialize};
use crate::{
logger,
plugin::{
Plugin,
types::{PluginHandshake, PluginJson},
},
};
use std::{
collections::HashMap,
fs,
io::{BufRead, BufReader, Read},
io::{BufRead, BufReader},
net::{TcpListener, TcpStream},
path::Path,
process::Command,
@@ -12,20 +17,6 @@ use std::{
logger!(LOGGER "Plugin Loader");
#[derive(Debug, Serialize, Deserialize)]
pub struct PluginJson {
pub id: String,
pub version: String,
pub supported_versions: Vec<String>,
pub file: String,
pub args: Vec<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PluginHandshake {
pub id: String,
}
pub struct PluginLoader {
plugin_clients: Arc<Mutex<HashMap<String, TcpStream>>>,
}
+1 -1
View File
@@ -2,7 +2,7 @@ pub mod loader;
pub mod types;
use std::{
io::{BufRead, BufReader, Read, Write},
io::{BufRead, BufReader, Write},
net::TcpStream,
};
+14
View File
@@ -1,5 +1,19 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct PluginJson {
pub id: String,
pub version: String,
pub supported_versions: Vec<String>,
pub file: String,
pub args: Vec<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PluginHandshake {
pub id: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", content = "params", rename_all = "snake_case")]
pub enum LoaderMessage {}