Signed-off-by: 未知时光 <732857315@qq.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user