Enum hcl_edit::expr::Expression
source · pub enum Expression {
Show 16 variants
Null(Decorated<Null>),
Bool(Decorated<bool>),
Number(Formatted<Number>),
String(Decorated<String>),
Array(Array),
Object(Object),
Template(StringTemplate),
HeredocTemplate(Box<HeredocTemplate>),
Parenthesis(Box<Parenthesis>),
Variable(Decorated<Ident>),
Conditional(Box<Conditional>),
FuncCall(Box<FuncCall>),
Traversal(Box<Traversal>),
UnaryOp(Box<UnaryOp>),
BinaryOp(Box<BinaryOp>),
ForExpr(Box<ForExpr>),
}Expand description
A type representing any expression from the expression sub-language.
Variants§
Null(Decorated<Null>)
Represents a null value.
Bool(Decorated<bool>)
Represents a boolean.
Number(Formatted<Number>)
Represents a number, either integer or float.
String(Decorated<String>)
Represents a string that does not contain any template interpolations or template directives.
Array(Array)
Represents an HCL array.
Object(Object)
Represents an HCL object.
Template(StringTemplate)
Represents a string containing template interpolations and template directives.
HeredocTemplate(Box<HeredocTemplate>)
Represents an HCL heredoc template.
Parenthesis(Box<Parenthesis>)
Represents a sub-expression wrapped in parenthesis.
Variable(Decorated<Ident>)
Represents a variable identifier.
Conditional(Box<Conditional>)
Represents conditional operator which selects one of two rexpressions based on the outcome of a boolean expression.
FuncCall(Box<FuncCall>)
Represents a function call.
Traversal(Box<Traversal>)
Represents an attribute or element traversal.
UnaryOp(Box<UnaryOp>)
Represents an operation which applies a unary operator to an expression.
BinaryOp(Box<BinaryOp>)
Represents an operation which applies a binary operator to two expressions.
ForExpr(Box<ForExpr>)
Represents a construct for constructing a collection by projecting the items from another collection.
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Expression
impl Debug for Expression
source§impl Decorate for Expression
impl Decorate for Expression
source§impl Display for Expression
impl Display for Expression
source§impl From<&str> for Expression
impl From<&str> for Expression
source§impl From<Array> for Expression
impl From<Array> for Expression
source§impl From<BinaryOp> for Expression
impl From<BinaryOp> for Expression
source§impl From<Conditional> for Expression
impl From<Conditional> for Expression
source§fn from(value: Conditional) -> Self
fn from(value: Conditional) -> Self
source§impl From<Expression> for ForCond
impl From<Expression> for ForCond
source§fn from(value: Expression) -> Self
fn from(value: Expression) -> Self
source§impl From<Expression> for ObjectKey
impl From<Expression> for ObjectKey
source§fn from(expr: Expression) -> Self
fn from(expr: Expression) -> Self
source§impl From<Expression> for ObjectValue
impl From<Expression> for ObjectValue
source§fn from(expr: Expression) -> Self
fn from(expr: Expression) -> Self
source§impl From<ForExpr> for Expression
impl From<ForExpr> for Expression
source§impl From<FuncCall> for Expression
impl From<FuncCall> for Expression
source§impl From<HeredocTemplate> for Expression
impl From<HeredocTemplate> for Expression
source§fn from(value: HeredocTemplate) -> Self
fn from(value: HeredocTemplate) -> Self
source§impl From<Ident> for Expression
impl From<Ident> for Expression
source§impl From<Number> for Expression
impl From<Number> for Expression
source§impl From<Object> for Expression
impl From<Object> for Expression
source§impl From<Parenthesis> for Expression
impl From<Parenthesis> for Expression
source§fn from(value: Parenthesis) -> Self
fn from(value: Parenthesis) -> Self
source§impl From<String> for Expression
impl From<String> for Expression
source§impl From<StringTemplate> for Expression
impl From<StringTemplate> for Expression
source§fn from(value: StringTemplate) -> Self
fn from(value: StringTemplate) -> Self
source§impl From<Traversal> for Expression
impl From<Traversal> for Expression
source§impl From<UnaryOp> for Expression
impl From<UnaryOp> for Expression
source§impl From<bool> for Expression
impl From<bool> for Expression
source§impl FromStr for Expression
impl FromStr for Expression
source§impl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
source§fn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
self and other values to be equal, and is used
by ==.