Signed-off-by: 未知时光 <732857315@qq.com>

This commit is contained in:
2026-06-09 16:23:24 +08:00
parent 1bf1f08f9a
commit f7919eca40
13 changed files with 1206 additions and 1 deletions

View File

@@ -16,6 +16,8 @@ pub struct PluginRecord {
pub syscalls: Vec<String>,
pub depends: Vec<String>,
pub exports: Vec<(String, String)>, // (name, description)
#[serde(default)]
pub endpoint: Option<String>,
pub status: PluginStatus,
}
@@ -95,6 +97,11 @@ impl PluginManager {
None
}
pub fn find_export_record(&self, target: &str, fn_name: &str) -> Option<PluginRecord> {
let plugin_id = self.find_export(target, fn_name)?;
self.get(&plugin_id)
}
pub fn unregister(&self, id: &str) -> Result<(), String> {
let mut plugins = self.plugins.lock().unwrap();
plugins