merge develop into master #20

Merged
michael-bailey merged 181 commits from develop into master 2023-12-01 21:48:28 +00:00
1 changed files with 30 additions and 0 deletions
Showing only changes of commit 9e4b7c316f - Show all commits

View File

@ -0,0 +1,30 @@
use std::collections::HashMap;
use std::sync::Arc;
use libloading::Library;
use crate::plugin::Plugin::Plugin;
/// # PluginManager
///
/// This struct handles the loading and unloading of plugins in the server
///
/// ## Attributes
/// - plugins: a hash_map of all loaded plugins
pub struct PluginManager {
plugins: HashMap<String, Arc<dyn Plugin>>
}
impl PluginManager {
pub fn new() -> Arc<Self>{
return Arc::new(Self {
plugins: HashMap::new()
})
}
pub async fn load(&self) {
unsafe {
println!("[PluginManager]: loading plugins");
println!("[PluginManager]: from: {}", std::env::current_dir().unwrap().to_string_lossy());
let lib = Library::new("./plugins")?;
}
}
}