pub struct PluginConfig {
pub native_plugins: Vec<NativePluginConfig>,
pub js_plugins: Vec<JsPluginConfig>,
pub overrides: HashMap<String, OverrideConfig>,
}Expand description
Complete plugin configuration.
Fields§
§native_plugins: Vec<NativePluginConfig>Native plugins to load.
js_plugins: Vec<JsPluginConfig>JavaScript plugins to load.
overrides: HashMap<String, OverrideConfig>Method overrides (key: “Object.method”).
Implementations§
Source§impl PluginConfig
impl PluginConfig
Sourcepub fn load(path: &Path) -> Result<Self, PluginError>
pub fn load(path: &Path) -> Result<Self, PluginError>
Load configuration from a TOML file.
Expected format:
[plugins]
native = [
{ path = "./plugins/libcustom.so", enabled = true }
]
javascript = [
{ path = "./plugins/utils.js", enabled = true }
]
[overrides]
"Array.map" = { plugin = "fast-array", method = "fastMap" }Sourcepub fn parse(content: &str) -> Result<Self, PluginError>
pub fn parse(content: &str) -> Result<Self, PluginError>
Parse configuration from a TOML string.
Note: This is a simple parser. For production use, consider using the toml crate.
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Source§fn clone(&self) -> PluginConfig
fn clone(&self) -> PluginConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginConfig
impl Debug for PluginConfig
Auto Trait Implementations§
impl Freeze for PluginConfig
impl RefUnwindSafe for PluginConfig
impl Send for PluginConfig
impl Sync for PluginConfig
impl Unpin for PluginConfig
impl UnwindSafe for PluginConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more