Skip to main content

PkgError

Enum PkgError 

Source
#[non_exhaustive]
pub enum PkgError { ManifestParse { source: Error, }, LockfileParse { source: Error, }, LockfileWrite { source: Error, }, MissingLockfile { path: PathBuf, }, SameNameConflict { name: String, }, Io { source: Error, }, Validation { message: String, }, GitFetch { source: Error, }, TagShaMismatch { expected: String, actual: String, }, EntryNotFound { name: String, attempted: Vec<PathBuf>, }, }
Expand description

Crate-wide error for PkgMgr operations.

§Error taxonomy

VariantPhaseSource
ManifestParseParsetoml::de::Error via #[from]
LockfileParseParsetoml::de::Error via map_err
LockfileWriteSerializetoml::ser::Error via #[from]
MissingLockfileI/Opath not found
SameNameConflictValidateduplicate name in lockfile
IoI/Ostd::io::Error via #[from]
ValidationPost-parsecustom message
GitFetchFetchgit2::Error via #[from]
TagShaMismatchFetchtag ↔ SHA conflict

Variants are #[non_exhaustive] so that future subtasks can add new variants without breaking downstream match arms that include a wildcard.

The existing crate::ResolveError is intentionally not modified.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

ManifestParse

TOML parse failure when reading mlua-pkg.toml.

Automatically constructed from toml::de::Error via ?.

Fields

§source: Error
§

LockfileParse

TOML parse failure when reading mlua-pkg.lock.

Does not carry #[from]ManifestParse already claims From<toml::de::Error>. Lockfile read paths must use .map_err(|e| PkgError::LockfileParse { source: e }) explicitly.

Fields

§source: Error
§

LockfileWrite

TOML serialization failure when writing mlua-pkg.lock.

Automatically constructed from toml::ser::Error via ?.

Fields

§source: Error
§

MissingLockfile

mlua-pkg.lock not found at the expected path.

Raised by Lockfile::read when the file is absent, to distinguish the “not yet installed” case from other I/O failures.

Fields

§path: PathBuf
§

SameNameConflict

Two packages share the same name field within a lockfile.

Package names must be unique within a lockfile. Raised during Lockfile::read and (in ST5) at install time.

Fields

§name: String
§

Io

I/O error while reading or writing files (manifest, lockfile, cache).

Automatically constructed from std::io::Error via ?.

Fields

§source: Error
§

Validation

Post-parse validation failure.

Raised when the parsed manifest satisfies TOML grammar but violates semantic constraints, e.g. specifying both tag and rev in a single dependency entry.

Fields

§message: String
§

GitFetch

git2 operation failure during fetch or clone.

Automatically constructed from git2::Error via ?.

Fields

§source: Error
§

TagShaMismatch

The resolved SHA for a tag did not match the expected SHA.

Raised when the caller pins a specific SHA together with a tag and the tag resolves to a different commit.

Fields

§expected: String
§actual: String
§

EntryNotFound

No suitable entry point directory found within a cached package.

Raised by mlua_pkg::resolve_entry when neither the override path nor any fallback candidate (src/, lua/, .) exists as a directory under cache_path.

Also raised during VendoredResolver::from_lockfile construction when a package in the lockfile has no resolvable entry.

Fields

§name: String
§attempted: Vec<PathBuf>

Trait Implementations§

Source§

impl Debug for PkgError

Source§

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

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

impl Display for PkgError

Source§

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

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

impl Error for PkgError

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 PkgError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PkgError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PkgError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for PkgError

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<E> ExternalError for E
where E: Into<Box<dyn Error>>,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.