pub struct Vfox {
pub runtime_version: String,
pub install_dir: PathBuf,
pub plugin_dir: PathBuf,
pub cache_dir: PathBuf,
pub download_dir: PathBuf,
pub skip_verification: bool,
pub cmd_env: Option<IndexMap<String, String>>,
pub default_inline_shell: Option<Vec<String>>,
pub github_token: Option<String>,
pub github_token_resolver: Option<Arc<dyn Fn() -> Option<String> + Send + Sync>>,
pub runtime_env_type: Option<String>,
/* private fields */
}Fields§
§runtime_version: String§install_dir: PathBuf§plugin_dir: PathBuf§cache_dir: PathBuf§download_dir: PathBuf§skip_verification: boolWhen true, skip attestation verification during install if the plugin also provides a sha256/sha512 checksum (so checksum integrity still applies). If the plugin has no checksums, attestation always runs regardless of this flag. Set by the caller when the lockfile already has a provenance entry from a prior install.
cmd_env: Option<IndexMap<String, String>>Optional environment to set on plugins before executing backend hooks.
When set, plugin.set_cmd_env() is called so Lua cmd.exec() uses this env
instead of inheriting the process environment. This allows dependency tools’
bin paths to be on PATH during version resolution and installation.
default_inline_shell: Option<Vec<String>>Shell command used by Lua cmd.exec().
github_token: Option<String>Optional GitHub token for Lua http requests to GitHub API endpoints.
github_token_resolver: Option<Arc<dyn Fn() -> Option<String> + Send + Sync>>Optional lazy resolver for the GitHub token. When set, the token is only
resolved if a Lua plugin actually makes an HTTP request to a GitHub API
URL — avoiding e.g. spawning github.credential_command for innocuous
commands like mise hook-env that never need a token. Takes precedence
over github_token when both are set.
runtime_env_type: Option<String>Optional runtime env type (gnu or musl) exposed to plugin hooks.
Implementations§
Source§impl Vfox
impl Vfox
pub fn new() -> Self
pub fn log_subscribe(&mut self) -> Receiver<String>
pub fn set_url_rewriter<F>(&mut self, rewriter: F)
pub fn set_http_headers_resolver<F>(&mut self, resolver: F)
pub fn list_available_sdks() -> &'static BTreeMap<String, Url>
pub async fn list_available_versions( &self, sdk: &str, ) -> Result<Vec<AvailableVersion>>
pub fn list_installed_versions(&self, sdk: &str) -> Result<Vec<SdkInfo>>
pub fn list_sdks(&self) -> Result<Vec<Plugin>>
pub fn get_sdk(&self, name: &str) -> Result<Plugin>
pub fn install_plugin(&self, sdk: &str) -> Result<Plugin>
pub fn install_plugin_from_url(&self, url: &Url) -> Result<Plugin>
pub fn uninstall_plugin(&self, sdk: &str) -> Result<()>
pub async fn install<ID: AsRef<Path>>( &self, sdk: &str, version: &str, install_dir: ID, ) -> Result<InstallResult>
pub async fn install_with_download_dir<ID: AsRef<Path>, DD: AsRef<Path>>( &self, sdk: &str, version: &str, install_dir: ID, download_dir: DD, ) -> Result<InstallResult>
pub async fn install_with_download_dir_and_options<ID: AsRef<Path>, DD: AsRef<Path>>( &self, sdk: &str, version: &str, install_dir: ID, download_dir: DD, options: IndexMap<String, Value>, ) -> Result<InstallResult>
pub async fn pre_uninstall<ID: AsRef<Path>>( &self, sdk: &str, version: &str, install_dir: ID, ) -> Result<()>
pub fn uninstall(&self, sdk: &str, version: &str) -> Result<()>
pub async fn pre_install_for_platform( &self, sdk: &str, version: &str, os: &str, arch: &str, ) -> Result<PreInstall>
pub async fn pre_install_for_platform_with_options( &self, sdk: &str, version: &str, os: &str, arch: &str, options: IndexMap<String, Value>, ) -> Result<PreInstall>
Sourcepub async fn pre_install_provenance_for_platform(
&self,
sdk: &str,
version: &str,
os: &str,
arch: &str,
) -> Result<(Option<String>, Option<VerifiedAttestation>)>
pub async fn pre_install_provenance_for_platform( &self, sdk: &str, version: &str, os: &str, arch: &str, ) -> Result<(Option<String>, Option<VerifiedAttestation>)>
Returns the download URL and the highest-priority verified attestation type declared by the plugin for the given platform, without performing actual verification or installation.
pub async fn pre_install_provenance_for_platform_with_options( &self, sdk: &str, version: &str, os: &str, arch: &str, options: IndexMap<String, Value>, ) -> Result<(Option<String>, Option<VerifiedAttestation>)>
pub async fn metadata(&self, sdk: &str) -> Result<Metadata>
pub async fn env_keys<T: Serialize>( &self, sdk: &str, version: &str, options: T, ) -> Result<Vec<EnvKey>>
pub async fn env_keys_for_install_dir<T: Serialize>( &self, sdk: &str, version: &str, install_dir: impl AsRef<Path>, options: T, ) -> Result<Vec<EnvKey>>
pub async fn mise_env<T: Serialize>( &self, sdk: &str, opts: T, env: &IndexMap<String, String>, config_root: Option<&str>, ) -> Result<MiseEnvResult>
pub async fn backend_list_versions( &self, sdk: &str, tool: &str, options: IndexMap<String, Value>, ) -> Result<Vec<String>>
pub async fn backend_install( &self, sdk: &str, tool: &str, version: &str, install_path: PathBuf, download_path: PathBuf, options: IndexMap<String, Value>, ) -> Result<()>
pub async fn backend_exec_env( &self, sdk: &str, tool: &str, version: &str, install_path: PathBuf, options: IndexMap<String, Value>, ) -> Result<Vec<EnvKey>>
pub async fn package_installed( &self, sdk: &str, ctx: PackageInstalledContext, ) -> Result<PackageInstalledResponse>
pub async fn package_install( &self, sdk: &str, ctx: PackageActionContext, ) -> Result<PackageActionResponse>
pub async fn package_upgrade( &self, sdk: &str, ctx: PackageActionContext, ) -> Result<PackageActionResponse>
pub async fn package_uninstall( &self, sdk: &str, ctx: PackageUninstallContext, ) -> Result<PackageActionResponse>
pub async fn mise_path<T: Serialize>( &self, sdk: &str, opts: T, env: &IndexMap<String, String>, config_root: Option<&str>, ) -> Result<Vec<String>>
pub async fn parse_legacy_file( &self, sdk: &str, file: &Path, ) -> Result<ParseLegacyFileResponse>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Vfox
impl !UnwindSafe for Vfox
impl Freeze for Vfox
impl Send for Vfox
impl Sync for Vfox
impl Unpin for Vfox
impl UnsafeUnpin for Vfox
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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