pub struct WasiPlugin { /* private fields */ }Expand description
Manifest-backed runtime that models a native WASI plugin contract.
Implementations§
Source§impl WasiPlugin
impl WasiPlugin
Sourcepub fn load(source: &Path) -> Result<Self, PluginError>
pub fn load(source: &Path) -> Result<Self, PluginError>
Loads a native plugin descriptor from component.toml.
Trait Implementations§
Source§impl Debug for WasiPlugin
impl Debug for WasiPlugin
Source§impl Plugin for WasiPlugin
impl Plugin for WasiPlugin
Source§fn manifest(&self) -> &PluginManifest
fn manifest(&self) -> &PluginManifest
Returns the immutable plugin manifest.
Source§fn available_versions(
&self,
_args: &[String],
) -> Result<Vec<AvailableVersion>, PluginError>
fn available_versions( &self, _args: &[String], ) -> Result<Vec<AvailableVersion>, PluginError>
Lists versions that the plugin can install.
Source§fn install_plan(&self, version: &str) -> Result<InstallPlan, PluginError>
fn install_plan(&self, version: &str) -> Result<InstallPlan, PluginError>
Builds an install plan for the requested version.
Source§fn env_keys(
&self,
runtime: &InstalledRuntime,
) -> Result<Vec<EnvKey>, PluginError>
fn env_keys( &self, runtime: &InstalledRuntime, ) -> Result<Vec<EnvKey>, PluginError>
Returns environment keys that should be exported for the installed version.
Source§fn parse_legacy_file(
&self,
file_name: &str,
_file_path: &Path,
content: &str,
installed_versions: &[String],
strategy: &str,
) -> Result<Option<String>, PluginError>
fn parse_legacy_file( &self, file_name: &str, _file_path: &Path, content: &str, installed_versions: &[String], strategy: &str, ) -> Result<Option<String>, PluginError>
Attempts to map a legacy file content to a version.
Source§fn post_install(&self, _runtime: &InstalledRuntime) -> Result<(), PluginError>
fn post_install(&self, _runtime: &InstalledRuntime) -> Result<(), PluginError>
Runs optional post-install logic after artifacts are materialized.
Source§fn pre_use(
&self,
_requested_version: &str,
_scope: &str,
_cwd: &Path,
_previous_version: Option<&str>,
_installed: &[InstalledRuntime],
) -> Result<Option<String>, PluginError>
fn pre_use( &self, _requested_version: &str, _scope: &str, _cwd: &Path, _previous_version: Option<&str>, _installed: &[InstalledRuntime], ) -> Result<Option<String>, PluginError>
Allows a plugin to map the requested version before activation.
Source§fn pre_uninstall(&self, _runtime: &InstalledRuntime) -> Result<(), PluginError>
fn pre_uninstall(&self, _runtime: &InstalledRuntime) -> Result<(), PluginError>
Runs optional pre-uninstall logic before a version is removed.
Auto Trait Implementations§
impl Freeze for WasiPlugin
impl RefUnwindSafe for WasiPlugin
impl Send for WasiPlugin
impl Sync for WasiPlugin
impl Unpin for WasiPlugin
impl UnsafeUnpin for WasiPlugin
impl UnwindSafe for WasiPlugin
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