Small plugin structure fix
This commit is contained in:
+8
-17
@@ -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
@@ -2,7 +2,7 @@ pub mod loader;
|
||||
pub mod types;
|
||||
|
||||
use std::{
|
||||
io::{BufRead, BufReader, Read, Write},
|
||||
io::{BufRead, BufReader, Write},
|
||||
net::TcpStream,
|
||||
};
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user