#[non_exhaustive]pub enum Predicate {
PathExists(String),
CmdAvailable(String),
RegKey {
path: String,
name: Option<String>,
},
Os(OsKind),
PsVersion(String),
SymlinkOk {
src: String,
dst: String,
},
AllOf(Vec<Predicate>),
AnyOf(Vec<Predicate>),
NoneOf(Vec<Predicate>),
}Expand description
A single leaf check or a nested combiner.
Parsed from a single-key YAML map via Predicate::from_yaml. The enum
intentionally mirrors the key set documented in actions.md.
Marked #[non_exhaustive] so new leaf predicates (plugin-contributed or
spec-extension) can land without breaking external match sites.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PathExists(String)
Filesystem path must exist.
CmdAvailable(String)
Named command is resolvable via PATH.
RegKey
Windows registry value is present. Only the map form
{ path, name } is accepted — the legacy hive\path!name string
form is rejected at parse time for unambiguity.
Fields
Os(OsKind)
Current OS matches.
PsVersion(String)
PowerShell version spec (e.g. >=5.1).
SymlinkOk
Privilege / developer-mode permits symlink creation for src → dst.
AllOf(Vec<Predicate>)
Nested AND combiner.
AnyOf(Vec<Predicate>)
Nested OR combiner.
NoneOf(Vec<Predicate>)
Nested NOR combiner.
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn from_yaml(value: &Value, depth: usize) -> Result<Self, PackParseError>
pub fn from_yaml(value: &Value, depth: usize) -> Result<Self, PackParseError>
Parse a single predicate entry from a serde_yaml::Value.
Each entry must be a map with exactly one key naming the
predicate kind. Depth-limited by MAX_REQUIRE_DEPTH to bound
pathological nesting.
Trait Implementations§
impl Eq for Predicate
impl StructuralPartialEq for Predicate
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl UnwindSafe for Predicate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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