Skip to main content

KitError

Enum KitError 

Source
pub enum KitError {
Show 23 variants NotInstalled { name: String, }, AlreadyInstalled { name: String, path: PathBuf, }, PluginInUse { name: String, }, ManifestRead { path: PathBuf, source: Error, }, ManifestParse { path: PathBuf, source: Box<Error>, }, ManifestMissingField { field: String, path: PathBuf, }, LibraryNotFound { name: String, tried: String, }, LibraryLoad { path: PathBuf, source: Box<Error>, }, SymbolMissing { symbol: String, }, NullEntry, LockTimeout { path: PathBuf, secs: u64, }, LockIo { path: PathBuf, source: Error, }, CargoNotFound, BuildFailed { code: Option<i32>, }, BuildArtifactMissing { stem: String, dir: String, }, NoManifest { dir: PathBuf, }, NoPackage { manifest: PathBuf, }, VersionMismatch { path: PathBuf, declared: String, crate_version: String, }, Http(String), Registry(String), PluginPanicked { what: String, }, NoDataDir, Io(Error),
}
Expand description

Errors produced by the kit.

The variants fall into two groups:

Variants§

§

NotInstalled

The plugin to uninstall or update is not installed.

Fields

§name: String

Full crate name.

§

AlreadyInstalled

The plugin to install is already present.

install never overwrites an existing installation; use update to replace it.

Fields

§name: String

Full crate name.

§path: PathBuf

The existing directory.

§

PluginInUse

The plugin’s dynamic library is still loaded in this process, so it cannot be deleted.

A .dll that is currently dlopened cannot be removed on Windows; on Linux/macOS the removal succeeds but the disk space is not reclaimed. Rather than gamble on it, ask the user to retry from a clean process.

Fields

§name: String

Full crate name.

§

ManifestRead

Reading the manifest file failed.

Fields

§path: PathBuf

Manifest path.

§source: Error

Underlying IO error.

§

ManifestParse

The manifest is not valid TOML, or a field has the wrong type.

Fields

§path: PathBuf

Manifest path.

§source: Box<Error>

Underlying TOML error.

§

ManifestMissingField

A required field in the manifest is missing or empty.

Fields

§field: String

Field name, e.g. plugin.name.

§path: PathBuf

Manifest path.

§

LibraryNotFound

No dynamic library matching the naming rules was found in the install dir.

Fields

§name: String

File name stem.

§tried: String

The file names that were tried, comma-separated.

§

LibraryLoad

dlopen itself failed (corrupt file, wrong architecture, missing dependencies).

Fields

§path: PathBuf

Dynamic library path.

§source: Box<Error>

Underlying libloading error.

§

SymbolMissing

The library loaded, but it does not export the symbol we look for.

Usually means the wrong thing was installed — e.g. a plain library placed in the plugin directory.

Fields

§symbol: String

The missing symbol name.

§

NullEntry

The plugin’s entry function returned a null pointer.

§

LockTimeout

Timed out waiting for the install lock.

Fields

§path: PathBuf

Lock file path.

§secs: u64

How many seconds were spent waiting.

§

LockIo

An operation on the lock file itself failed.

Fields

§path: PathBuf

Lock file path.

§source: Error

Underlying IO error.

§

CargoNotFound

No cargo on PATH, so build-host installation is unavailable.

The caller can use this to tell the user to install a Rust toolchain, or to fall back to prebuilt.

§

BuildFailed

cargo build failed. stderr has already been passed through to the user (stdio is inherited).

Fields

§code: Option<i32>

Process exit code. None when the process was killed by a signal.

§

BuildArtifactMissing

The build succeeded, but there is no cdylib among its artifacts.

Fields

§stem: String

Expected file name stem.

§dir: String

Directories that were searched.

§

NoManifest

No Cargo.toml where one was expected.

Fields

§dir: PathBuf

The directory that was looked in.

§

NoPackage

cargo metadata did not describe the crate whose manifest was given.

Either the manifest is not part of the reported workspace, or the output could not be matched to it.

Fields

§manifest: PathBuf

Manifest path that was asked about.

§

VersionMismatch

The plugin manifest’s [plugin] version disagrees with the crate’s own version.

Release assets carry both, and they have to be the same number: the manifest is what a host reads before it downloads anything, and the asset file name is built from the crate version.

Fields

§path: PathBuf

Manifest path.

§declared: String

Version declared inside the manifest.

§crate_version: String

Version declared by Cargo.toml.

§

Http(String)

The network request failed. The message carries the URL and status code.

§

Registry(String)

The registry returned content we could fetch but that is not what we expect.

§

PluginPanicked

A plugin panicked during a cross-boundary call (caught by catch_unwind on the host side).

Fields

§what: String

Which call site, e.g. "entry()".

§

NoDataDir

Neither HOME nor an equivalent system directory is available, so the data dir cannot be determined.

§

Io(Error)

IO error.

Trait Implementations§

Source§

impl Debug for KitError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for KitError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for KitError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for KitError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.