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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more