pub struct App { /* private fields */ }Expand description
Top-level application orchestrator.
Implementations§
Source§impl App
impl App
Sourcepub fn add_plugin(
&self,
name: Option<&str>,
source: Option<String>,
backend: Option<PluginBackendKind>,
alias: Option<&str>,
) -> Result<RegistryEntry, CoreError>
pub fn add_plugin( &self, name: Option<&str>, source: Option<String>, backend: Option<PluginBackendKind>, alias: Option<&str>, ) -> Result<RegistryEntry, CoreError>
Adds a plugin to the local home.
Source§impl App
impl App
Sourcepub fn available_plugins(&self) -> Result<Vec<RegistryEntry>, CoreError>
pub fn available_plugins(&self) -> Result<Vec<RegistryEntry>, CoreError>
Lists plugins in the available registry index.
Sourcepub fn added_plugins(&self) -> Result<Vec<RegistryEntry>, CoreError>
pub fn added_plugins(&self) -> Result<Vec<RegistryEntry>, CoreError>
Lists plugins added to the local home.
Source§impl App
impl App
Source§impl App
impl App
Sourcepub fn cleanup_session(&self) -> Result<(), CoreError>
pub fn cleanup_session(&self) -> Result<(), CoreError>
Removes the session tools file for the current session.
Called by the shell EXIT trap via vs __cleanup-session so that
the home directory is resolved at runtime rather than hardcoded
in the activation script.
Sourcepub fn cleanup_stale_sessions(&self) -> Result<(), CoreError>
pub fn cleanup_stale_sessions(&self) -> Result<(), CoreError>
Removes session files for processes that no longer exist.
Called during activation for shells that lack an EXIT trap
(nushell, clink) via vs __cleanup-stale-sessions.
Source§impl App
impl App
Sourcepub fn list_config(&self) -> Result<Vec<(String, String)>, CoreError>
pub fn list_config(&self) -> Result<Vec<(String, String)>, CoreError>
Lists current application config values.
Sourcepub fn config_value(&self) -> Result<Value, CoreError>
pub fn config_value(&self) -> Result<Value, CoreError>
Returns the whole config as a YAML-like value.
Sourcepub fn config_entries_for_key(
&self,
key: &str,
) -> Result<Vec<(String, String)>, CoreError>
pub fn config_entries_for_key( &self, key: &str, ) -> Result<Vec<(String, String)>, CoreError>
Returns config entries for an exact key or section prefix.
Source§impl App
impl App
Sourcepub fn current_tool(
&self,
plugin_name: &str,
) -> Result<Option<CurrentTool>, CoreError>
pub fn current_tool( &self, plugin_name: &str, ) -> Result<Option<CurrentTool>, CoreError>
Resolves the active version for a specific plugin.
Sourcepub fn current_tools(&self) -> Result<Vec<CurrentTool>, CoreError>
pub fn current_tools(&self) -> Result<Vec<CurrentTool>, CoreError>
Resolves all active tools for the current context.
Source§impl App
impl App
Sourcepub fn plugin_info(&self, name: &str) -> Result<PluginInfo, CoreError>
pub fn plugin_info(&self, name: &str) -> Result<PluginInfo, CoreError>
Loads registry and backend metadata for a plugin.
Source§impl App
impl App
Sourcepub fn install_plugin_version(
&self,
plugin_name: &str,
version: Option<&str>,
) -> Result<InstalledVersion, CoreError>
pub fn install_plugin_version( &self, plugin_name: &str, version: Option<&str>, ) -> Result<InstalledVersion, CoreError>
Installs a plugin version, choosing the first available version when omitted.
Source§impl App
impl App
Sourcepub fn list_installed_versions(
&self,
) -> Result<Vec<InstalledVersion>, CoreError>
pub fn list_installed_versions( &self, ) -> Result<Vec<InstalledVersion>, CoreError>
Lists installed tool versions in the local cache.
Source§impl App
impl App
Sourcepub fn search_versions(
&self,
plugin_name: &str,
args: &[String],
) -> Result<Vec<AvailableVersion>, CoreError>
pub fn search_versions( &self, plugin_name: &str, args: &[String], ) -> Result<Vec<AvailableVersion>, CoreError>
Lists available SDK versions for a plugin.
Source§impl App
impl App
Sourcepub fn uninstall_plugin_version(
&self,
plugin_name: &str,
version: &str,
) -> Result<UninstallResult, CoreError>
pub fn uninstall_plugin_version( &self, plugin_name: &str, version: &str, ) -> Result<UninstallResult, CoreError>
Uninstalls a plugin version from the local cache.
When the uninstalled version is currently active and other versions remain, auto-switches to the first remaining version (global scope). When no versions remain, removes the entire plugin cache directory.
Source§impl App
impl App
Sourcepub fn update_registry(&self) -> Result<usize, CoreError>
pub fn update_registry(&self) -> Result<usize, CoreError>
Refreshes the searchable plugin index from the configured registry source.
Sourcepub fn update_plugin(&self, name: &str) -> Result<RegistryEntry, CoreError>
pub fn update_plugin(&self, name: &str) -> Result<RegistryEntry, CoreError>
Updates a locally added plugin from its manifest URL or registry metadata.
Sourcepub fn update_all_plugins(&self) -> Result<Vec<RegistryEntry>, CoreError>
pub fn update_all_plugins(&self) -> Result<Vec<RegistryEntry>, CoreError>
Updates every locally added plugin.
Source§impl App
impl App
Sourcepub fn self_upgrade_summary(&self) -> Result<SelfUpgradeSummary, CoreError>
pub fn self_upgrade_summary(&self) -> Result<SelfUpgradeSummary, CoreError>
Returns the current and latest available self-upgrade versions.
Sourcepub fn upgrade_self_to(
&self,
latest_version: &str,
) -> Result<SelfUpgradeSummary, CoreError>
pub fn upgrade_self_to( &self, latest_version: &str, ) -> Result<SelfUpgradeSummary, CoreError>
Upgrades the running vs binary to the provided published release version.
Source§impl App
impl App
Sourcepub fn use_tool(
&self,
plugin_name: &str,
version: &str,
scope: UseScope,
unlink: bool,
) -> Result<InstalledVersion, CoreError>
pub fn use_tool( &self, plugin_name: &str, version: &str, scope: UseScope, unlink: bool, ) -> Result<InstalledVersion, CoreError>
Activates an installed tool version for a given scope.
Sourcepub fn project_tool_version_for_use(
&self,
plugin_name: &str,
) -> Result<Option<String>, CoreError>
pub fn project_tool_version_for_use( &self, plugin_name: &str, ) -> Result<Option<String>, CoreError>
Resolves the version from the project config file when no version is
specified on the CLI (empty string). Returns None when no project
config is found.
Sourcepub fn installed_versions_for_plugin(
&self,
plugin_name: &str,
) -> Result<Vec<InstalledVersion>, CoreError>
pub fn installed_versions_for_plugin( &self, plugin_name: &str, ) -> Result<Vec<InstalledVersion>, CoreError>
Returns installed versions for a single plugin, sorted from newest-looking to oldest-looking.
Source§impl App
impl App
Sourcepub fn version_info(&self) -> Result<VersionInfo, CoreError>
pub fn version_info(&self) -> Result<VersionInfo, CoreError>
Returns version and build metadata for the current binary.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl UnwindSafe for App
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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