pub struct Variable {
pub value: ValueWord,
pub kind: VarKind,
pub is_initialized: bool,
pub is_function_scoped: bool,
pub format_hint: Option<String>,
pub format_overrides: Option<HashMap<String, ValueWord>>,
}Expand description
A variable in the execution context
Fields§
§value: ValueWordThe variable’s current value (NaN-boxed for compact 8-byte storage)
kind: VarKindThe variable kind (let, var, const)
is_initialized: boolWhether the variable has been initialized
is_function_scoped: boolWhether this is a function-scoped variable (var, Flexible ownership) vs block-scoped (let/const, Owned{Immutable,Mutable} ownership)
format_hint: Option<String>Optional format hint for display (e.g., “Percent” for meta lookup)
format_overrides: Option<HashMap<String, ValueWord>>Optional format parameter overrides from type alias (e.g., { decimals: 4 } from type Percent4 = Percent { decimals: 4 })
Implementations§
Source§impl Variable
impl Variable
Sourcepub fn with_format(
kind: VarKind,
value: Option<ValueWord>,
format_hint: Option<String>,
format_overrides: Option<HashMap<String, ValueWord>>,
) -> Self
pub fn with_format( kind: VarKind, value: Option<ValueWord>, format_hint: Option<String>, format_overrides: Option<HashMap<String, ValueWord>>, ) -> Self
Create a new variable with format hint and parameter overrides
Sourcepub fn can_assign(&self) -> bool
pub fn can_assign(&self) -> bool
Check if this variable can be assigned to
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnsafeUnpin for Variable
impl UnwindSafe for Variable
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,
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>
Converts
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>
Converts
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