pub struct PluginContext {
pub client_name: String,
pub client_version: String,
pub capabilities: HashMap<String, Value>,
pub config: HashMap<String, Value>,
pub available_plugins: Vec<String>,
}
Expand description
Context information available to plugins during initialization
Fields§
§client_name: String
Client information
client_version: String
§capabilities: HashMap<String, Value>
Available capabilities
config: HashMap<String, Value>
Configuration values
available_plugins: Vec<String>
Registered plugin names (for dependency checking)
Implementations§
Source§impl PluginContext
impl PluginContext
Sourcepub fn new(
client_name: String,
client_version: String,
capabilities: HashMap<String, Value>,
config: HashMap<String, Value>,
available_plugins: Vec<String>,
) -> Self
pub fn new( client_name: String, client_version: String, capabilities: HashMap<String, Value>, config: HashMap<String, Value>, available_plugins: Vec<String>, ) -> Self
Create a new plugin context
Sourcepub fn has_capability(&self, capability: &str) -> bool
pub fn has_capability(&self, capability: &str) -> bool
Check if a capability is available
Sourcepub fn get_config(&self, key: &str) -> Option<&Value>
pub fn get_config(&self, key: &str) -> Option<&Value>
Get a configuration value
Sourcepub fn has_plugin(&self, plugin_name: &str) -> bool
pub fn has_plugin(&self, plugin_name: &str) -> bool
Check if a plugin dependency is available
Trait Implementations§
Source§impl Clone for PluginContext
impl Clone for PluginContext
Source§fn clone(&self) -> PluginContext
fn clone(&self) -> PluginContext
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 moreAuto Trait Implementations§
impl Freeze for PluginContext
impl RefUnwindSafe for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnwindSafe for PluginContext
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