pub struct PluginMetadata {
pub name: String,
pub version: String,
pub description: String,
pub capabilities: Vec<PluginCapability>,
pub hooks: Vec<PluginHook>,
}Expand description
Metadata describing a plugin, including its identity, required capabilities, and the hooks it supports.
Fields§
§name: StringUnique plugin name.
version: StringPlugin version string (semver).
description: StringHuman-readable description of the plugin.
capabilities: Vec<PluginCapability>Capabilities this plugin requires.
hooks: Vec<PluginHook>Lifecycle hooks this plugin handles.
Implementations§
Source§impl PluginMetadata
impl PluginMetadata
Sourcepub fn new(name: &str, version: &str, description: &str) -> Self
pub fn new(name: &str, version: &str, description: &str) -> Self
Create a new plugin metadata with the given identity.
Sourcepub fn add_capability(&mut self, capability: PluginCapability)
pub fn add_capability(&mut self, capability: PluginCapability)
Declare that this plugin requires the given capability.
Sourcepub fn add_hook(&mut self, hook: PluginHook)
pub fn add_hook(&mut self, hook: PluginHook)
Register a lifecycle hook that this plugin handles.
Sourcepub fn has_capability(&self, capability: PluginCapability) -> bool
pub fn has_capability(&self, capability: PluginCapability) -> bool
Check whether this plugin requires the given capability.
Sourcepub fn supports_hook(&self, hook: PluginHook) -> bool
pub fn supports_hook(&self, hook: PluginHook) -> bool
Check whether this plugin supports the given hook.
Trait Implementations§
Source§impl Clone for PluginMetadata
impl Clone for PluginMetadata
Source§fn clone(&self) -> PluginMetadata
fn clone(&self) -> PluginMetadata
Returns a duplicate of the value. Read more
1.0.0§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 PluginMetadata
impl RefUnwindSafe for PluginMetadata
impl Send for PluginMetadata
impl Sync for PluginMetadata
impl Unpin for PluginMetadata
impl UnwindSafe for PluginMetadata
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)