#[non_exhaustive]pub enum PackParseError {
Show 13 variants
InvalidSchemaVersion {
got: String,
},
InvalidName {
got: String,
},
YamlAliasRejected,
UnknownTopLevelKey {
key: String,
},
UnknownActionKey {
key: String,
},
EmptyActionEntry,
MultipleActionKeys {
keys: Vec<String>,
},
RequireCombinerArity {
count: usize,
},
InvalidPredicate {
detail: String,
},
ExecCmdMutex {
shell: bool,
cmd_present: bool,
cmd_shell_present: bool,
},
RequireDepthExceeded {
depth: usize,
max: usize,
},
WithPath {
path: String,
source: Box<PackParseError>,
},
Inner(Error),
}Expand description
Errors produced by crate::pack::parse and related entry points.
Each variant is designed to be self-describing when rendered through
Display (via thiserror), so eprintln!("{err}") is sufficient for a
CLI diagnostic. File-path context, when available, is attached by the
caller using PackParseError::with_source_path.
Marked #[non_exhaustive] so new diagnostic variants can land without
breaking external match sites.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidSchemaVersion
schema_version is present but not the supported literal "1".
InvalidName
name does not match ^[a-z][a-z0-9-]*$.
YamlAliasRejected
The raw YAML contains an anchor (&) or alias (*) node. grex
rejects these at parse time as a security policy (cycle / billion-
laughs mitigation).
UnknownTopLevelKey
A top-level key was present that is neither a known manifest field
nor prefixed with x- (reserved-for-extension namespace).
UnknownActionKey
An action entry’s single-key map names an action not in the Tier-1 registry.
EmptyActionEntry
An action entry is an empty map (- {}).
MultipleActionKeys
An action entry has more than one top-level key, e.g.
- { symlink: ..., env: ... }.
RequireCombinerArity
A require (or when) spec declares zero combiners when at least
one is required, or more than one combiner at the same level.
InvalidPredicate
A predicate entry is shaped wrong (not a single-key map, or the key names an unknown predicate).
ExecCmdMutex
An exec spec violates the cmd XOR cmd_shell invariant.
Fields
RequireDepthExceeded
The recursive predicate tree exceeded MAX_REQUIRE_DEPTH.
WithPath
Wrap an inner error with the offending source-file path so CLI
callers can present path: error diagnostics.
Fields
source: Box<PackParseError>Underlying error.
Inner(Error)
Underlying serde_yaml deserialization error (malformed YAML, type
mismatch, etc.).
Implementations§
Source§impl PackParseError
impl PackParseError
Sourcepub fn with_source_path(self, path: impl Into<String>) -> Self
pub fn with_source_path(self, path: impl Into<String>) -> Self
Attach source-file context to an error. Intended for the entry point that reads a file from disk; Stage A’s pure-parse API does not use it directly but surfaces it for consumers.
Trait Implementations§
Source§impl Debug for PackParseError
impl Debug for PackParseError
Source§impl Display for PackParseError
impl Display for PackParseError
Source§impl Error for PackParseError
impl Error for PackParseError
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 Freeze for PackParseError
impl !RefUnwindSafe for PackParseError
impl Send for PackParseError
impl Sync for PackParseError
impl Unpin for PackParseError
impl UnsafeUnpin for PackParseError
impl !UnwindSafe for PackParseError
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> 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