Skip to main content

literal_expr_value

Function literal_expr_value 

Source
pub fn literal_expr_value(value: &ExprValue) -> Option<Value>
Expand description

Project the literal part of an ExprValue to JSON, dropping whatever is only known at run time.

rite check has no artifacts, no backend, and no evaluated parameters, so an Expr or Interpolated node has no value to inspect. Such a node yields None, and an object field holding one is left out of the object. An array containing one yields None as a whole: object fields are addressed by name, so an absent one is visible to whoever reads the result, while array elements are addressed by position, and silently dropping one renumbers the rest.

The result is therefore a subset of the block the runtime’s evaluate_expr_value will build. A caller must not read an absent field as unset.