#[repr(u8)]pub enum Expr {
Literal(String),
Environment(String),
Variable(String),
Secret(String),
File(Box<Self>),
First(Vec<Self>),
}Expand description
Where a value comes from.
An expression is externally tagged in JSON, with snake case tags.
use ephemeris_expr::Expr;
let expr = Expr::First(vec![
Expr::Environment("TOKEN".to_owned()),
Expr::Literal("fallback".to_owned()),
]);
assert_eq!(
expr.to_string(),
"first of [environment TOKEN, literal \"fallback\"]"
);Variants§
Literal(String)
The text itself.
Environment(String)
The environment variable of that name.
Variable(String)
The environment variable of that name, declared as a CI variable.
Secret(String)
The environment variable of that name, declared as a CI secret.
File(Box<Self>)
The contents of the file the inner expression names.
First(Vec<Self>)
The first expression whose inputs are present.
Trait Implementations§
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.