pub enum Evaluation {
String(String),
Number(f64),
Boolean(bool),
Null,
Array(Vec<Evaluation>),
Object(HashMap<String, Evaluation>),
}Expand description
The result of evaluating a GitHub Actions expression.
This type represents the possible values that can result from evaluating GitHub Actions expressions.
Variants§
String(String)
A string value (includes both string literals and stringified other types).
Number(f64)
A numeric value.
Boolean(bool)
A boolean value.
Null
The null value.
Array(Vec<Evaluation>)
An array value. Array evaluations can only be realized through fromJSON.
Object(HashMap<String, Evaluation>)
An object value. Object evaluations can only be realized through fromJSON.
Implementations§
Source§impl Evaluation
impl Evaluation
Sourcepub fn as_boolean(&self) -> bool
pub fn as_boolean(&self) -> bool
Convert to a boolean following GitHub Actions truthiness rules.
GitHub Actions truthiness:
- false and null are falsy
- Numbers: 0 and NaN are falsy, everything else is truthy
- Strings: empty string is falsy, everything else is truthy
- Arrays and dictionaries are always truthy (non-empty objects)
Sourcepub fn as_number(&self) -> f64
pub fn as_number(&self) -> f64
Convert to a number following GitHub Actions conversion rules.
See: https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#operators
Sourcepub fn sema(&self) -> EvaluationSema<'_>
pub fn sema(&self) -> EvaluationSema<'_>
Returns a wrapper around this evaluation that implements GitHub Actions evaluation semantics.
Trait Implementations§
Source§impl Clone for Evaluation
impl Clone for Evaluation
Source§fn clone(&self) -> Evaluation
fn clone(&self) -> Evaluation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more