Make unshell-lib, and module system with components.

This commit is contained in:
Michael Mikovsky
2025-11-08 14:56:03 -07:00
parent 8f33945633
commit 3dba32264c
27 changed files with 461 additions and 311 deletions
+28
View File
@@ -0,0 +1,28 @@
#![no_main]
use std::collections::HashMap;
use unshell_lib::Component;
#[unsafe(no_mangle)]
pub fn get_components() -> HashMap<&'static str, Box<dyn Component>> {
let mut components: HashMap<&'static str, Box<dyn Component>> = HashMap::new();
#[cfg(feature = "client")]
components.insert(
unshell_lib::client::MODULE_NAME,
Box::new(unshell_lib::client::ClientComponent::new()),
);
components
// vec![
// Feature::Client,
// #[cfg(feature = "server")]
// Feature::Server,
// ]
}
#[cfg(feature = "client")]
pub use unshell_lib::client::*;
#[cfg(feature = "server")]
pub use unshell_lib::server::*;