#[non_exhaustive]pub struct Variable {
pub name: Arc<str>,
pub description: Option<Arc<str>>,
pub type_expr: Option<Expression>,
pub default: Option<Expression>,
pub sensitive: bool,
pub span: Span,
}Expand description
A variable "name" {} declaration inside a component.
Debug redacts default when sensitive == true, per
10-data-model.md § 2.5 (I-IR-8).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: Arc<str>Variable name.
description: Option<Arc<str>>Optional description = "...".
type_expr: Option<Expression>Optional type = ... expression (kept as-is; we do not parse the
HCL type-constructor mini-language in Phase 1).
default: Option<Expression>Optional default = ... value. Pre-evaluation this is an
Expression; post-evaluation it may be reduced to a
Value.
sensitive: boolWhether the variable was declared sensitive = true.
span: SpanSpan of the variable keyword.
Implementations§
Source§impl Variable
impl Variable
Sourcepub fn builder() -> VariableBuilder<((), (), (), (), (), ())>
pub fn builder() -> VariableBuilder<((), (), (), (), (), ())>
Create a builder for building Variable.
On the builder, call .name(...), .description(...)(optional), .type_expr(...)(optional), .default(...)(optional), .sensitive(...)(optional), .span(...) to set the values of the fields.
Finally, call .build() to create the instance of Variable.