pub struct Binding {
pub targets: Vec<String>,
pub value: Expr,
pub modifier: BindingModifier,
pub type_annotation: Option<String>,
pub span: Span,
}Expand description
A name-to-expression binding (per-cycle by default;
const/shared/volatile modifier changes the
lifecycle). Replaces the former CycleBinding and
InitBinding AST variants — the surface unified to one
shape name := expr (or (a, b, c) := expr for tuple
destructuring), with the modifier driving runtime
lifecycle.
Fields§
§targets: Vec<String>The bound names: one, or several for tuple destructuring.
value: ExprThe right-hand side.
modifier: BindingModifierThe wire-coloring keywords written before the names.
type_annotation: Option<String>Optional explicit type annotation — shared name: f64 := 1.
Only meaningful on shared bindings (scope_model.md §“Type
stability”): it pins the CELL’s PortType for life, winning over
literal inference (so 1 vs 1.0 stops being load-bearing).
The parser rejects annotations on non-shared bindings.
span: SpanWhere the binding appears.