Skip to main content

PluginHost

Struct PluginHost 

pub struct PluginHost { /* private fields */ }
Expand description

Manages the lifecycle of WASM plugins.

Implementations§

Source§

impl PluginHost

Source

pub fn new(workspace_dir: &Path) -> Result<Self, PluginError>

Create a new plugin host rooted at workspace_dir, scanning its plugins/ subdirectory.

Source

pub fn with_security( workspace_dir: &Path, signature_mode: SignatureMode, trusted_publisher_keys: Vec<String>, ) -> Result<Self, PluginError>

Create a host rooted at workspace_dir (scanning workspace_dir/plugins) with signature verification settings.

Source

pub fn from_plugins_dir(plugins_dir: &Path) -> Result<Self, PluginError>

Create a host that scans plugins_dir directly (no plugins/ suffix is appended). Use this when the caller already holds the fully resolved plugin directory, e.g. PluginsConfig::resolved_plugins_dir().

Source

pub fn from_plugins_dir_with_security( plugins_dir: &Path, signature_mode: SignatureMode, trusted_publisher_keys: Vec<String>, ) -> Result<Self, PluginError>

Self::from_plugins_dir with signature verification settings.

Source

pub fn parse_signature_mode(mode: &str) -> Option<SignatureMode>

Source

pub fn resolve_signature_mode(mode: &str) -> SignatureMode

Source

pub fn list_plugins(&self) -> Vec<PluginInfo>

List all discovered plugins.

Source

pub fn get_plugin(&self, name: &str) -> Option<PluginInfo>

Get info about a specific plugin.

Source

pub fn install(&mut self, source: &str) -> Result<String, PluginError>

Install a plugin from a directory path. Returns the installed plugin’s manifest name so callers can key follow-up work (config seeding, messaging) off the canonical name rather than the source path.

Source

pub fn remove(&mut self, name: &str) -> Result<(), PluginError>

Remove a plugin by name.

Source

pub fn tool_plugins(&self) -> Vec<&PluginManifest>

Get tool-capable plugins.

Source

pub fn tool_plugin_details(&self) -> Vec<(&PluginManifest, &Path)>

Get tool-capable plugins with their resolved WASM file paths. Returns (manifest, resolved_wasm_path) tuples for building WasmTools. Tool plugins without a wasm_path are skipped.

Source

pub fn channel_plugins(&self) -> Vec<&PluginManifest>

Get channel-capable plugins.

Source

pub fn channel_plugin_details(&self) -> Vec<(&PluginManifest, &Path)>

Source

pub fn skill_plugins(&self) -> Vec<&PluginManifest>

Get skill-capable plugins.

Source

pub fn skill_plugin_details(&self) -> Vec<(&PluginManifest, PathBuf)>

Source

pub fn plugins_dir(&self) -> &Path

Returns the plugins directory path.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more