#[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
| Variant | Phase | Source |
|---|---|---|
ManifestParse | Parse | toml::de::Error via #[from] |
LockfileParse | Parse | toml::de::Error via map_err |
LockfileWrite | Serialize | toml::ser::Error via #[from] |
MissingLockfile | I/O | path not found |
SameNameConflict | Validate | duplicate name in lockfile |
Io | I/O | std::io::Error via #[from] |
Validation | Post-parse | custom message |
GitFetch | Fetch | git2::Error via #[from] |
TagShaMismatch | Fetch | tag ↔ 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
ManifestParse
TOML parse failure when reading mlua-pkg.toml.
Automatically constructed from toml::de::Error via ?.
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.
LockfileWrite
TOML serialization failure when writing mlua-pkg.lock.
Automatically constructed from toml::ser::Error via ?.
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.
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.
Io
I/O error while reading or writing files (manifest, lockfile, cache).
Automatically constructed from std::io::Error via ?.
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.
GitFetch
git2 operation failure during fetch or clone.
Automatically constructed from git2::Error via ?.
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.
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.
Trait Implementations§
Source§impl Error for PkgError
impl Error for PkgError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for PkgError
impl !UnwindSafe for PkgError
impl Freeze for PkgError
impl Send for PkgError
impl Sync for PkgError
impl Unpin for PkgError
impl UnsafeUnpin for PkgError
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<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
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