pub struct PluginManager { /* private fields */ }
Expand description
Provides accesses to functionality to inspect and manage the installation of plugins.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn try_default() -> Result<Self>
pub fn try_default() -> Result<Self>
Creates a PluginManager
with the default install location.
Sourcepub fn store(&self) -> &PluginStore
pub fn store(&self) -> &PluginStore
Returns the underlying store object
Sourcepub async fn install(
&self,
plugin_manifest: &PluginManifest,
plugin_package: &PluginPackage,
source: &ManifestLocation,
auth_header_value: &Option<String>,
) -> Result<String>
pub async fn install( &self, plugin_manifest: &PluginManifest, plugin_package: &PluginPackage, source: &ManifestLocation, auth_header_value: &Option<String>, ) -> Result<String>
Installs the Spin plugin with the given manifest If installing a plugin from the centralized Spin plugins repository, it fetches the latest contents of the repository and searches for the appropriately named and versioned plugin manifest. Parses the plugin manifest to get the appropriate source for the machine OS and architecture. Verifies the checksum of the source, unpacks and installs it into the plugins directory. Returns name of plugin that was successfully installed.
Sourcepub fn uninstall(&self, plugin_name: &str) -> Result<bool>
pub fn uninstall(&self, plugin_name: &str) -> Result<bool>
Uninstalls a plugin with a given name, removing it and it’s manifest from the local plugins directory. Returns true if plugin was successfully uninstalled and false if plugin did not exist.
Sourcepub fn check_manifest(
&self,
plugin_manifest: &PluginManifest,
spin_version: &str,
override_compatibility_check: bool,
allow_downgrades: bool,
) -> Result<InstallAction>
pub fn check_manifest( &self, plugin_manifest: &PluginManifest, spin_version: &str, override_compatibility_check: bool, allow_downgrades: bool, ) -> Result<InstallAction>
Checks manifest to see if the plugin is compatible with the running version of Spin, does not have a conflicting name with Spin internal commands, and is not a downgrade of a currently installed plugin.
Sourcepub async fn get_manifest(
&self,
manifest_location: &ManifestLocation,
skip_compatibility_check: bool,
spin_version: &str,
auth_header_value: &Option<String>,
) -> PluginLookupResult<PluginManifest>
pub async fn get_manifest( &self, manifest_location: &ManifestLocation, skip_compatibility_check: bool, spin_version: &str, auth_header_value: &Option<String>, ) -> PluginLookupResult<PluginManifest>
Fetches a manifest from a local, remote, or repository location and returned the parsed PluginManifest object.
pub async fn update_lock(&self) -> PluginManagerUpdateLock
Auto Trait Implementations§
impl Freeze for PluginManager
impl RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl UnwindSafe for PluginManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more