-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add clone to Variant and plugin functions
- Loading branch information
Showing
4 changed files
with
141 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
use std::collections::HashMap; | ||
|
||
use super::variant::TVariant; | ||
use super::variant::Variant; | ||
|
||
pub fn plugin_data() -> HashMap<String, Box<dyn TVariant>> { | ||
HashMap::new() | ||
pub fn plugin_data() -> PluginData { | ||
PluginData(HashMap::new()) | ||
} | ||
|
||
#[repr(C)] | ||
pub struct PluginCapabilities(Vec<String>); | ||
|
||
impl PluginCapabilities { | ||
pub fn get_capabilities(&self) -> Vec<String> { | ||
self.0.clone() | ||
} | ||
} | ||
|
||
#[repr(C)] | ||
pub struct PluginData(HashMap<String, Variant>); | ||
|
||
impl PluginData { | ||
pub fn get_data(&self) -> HashMap<String, Variant> { | ||
self.0.clone() | ||
} | ||
} |
Oops, something went wrong.