pub enum Value {
Str(String),
Int(i64),
UInt(u64),
Float(f64),
Bool(bool),
Null,
Dict(Vec<(String, Value)>),
List(Vec<Value>),
F32Array(Vec<f32>),
Param(String, Option<Box<Span>>),
PositionalParam(usize, Option<Box<Span>>),
}Expand description
QQL literal value: string, number, bool, null, object, or list.
Variants§
Str(String)
String literal ('…').
Int(i64)
Integer literal.
UInt(u64)
Unsigned integer literal: bare digit literals that overflow i64
(up to u64::MAX) parse here instead of failing or becoming strings.
Float(f64)
Floating-point literal.
Bool(bool)
Boolean literal (true / false).
Null
null literal.
Dict(Vec<(String, Value)>)
{key: value, …} object; entries keep their written order.
List(Vec<Value>)
[v1, v2, …] list literal (also dense vector input).
F32Array(Vec<f32>)
Flat array of f32 (dense vector). Bypasses per-element float boxing.
Param(String, Option<Box<Span>>)
Named parameter placeholder (:name).
PositionalParam(usize, Option<Box<Span>>)
Positional parameter placeholder (?).
Implementations§
Source§impl Value
impl Value
Sourcepub fn dict_get(&self, key: &str) -> Option<&Value>
pub fn dict_get(&self, key: &str) -> Option<&Value>
Case-insensitive lookup of a Dict entry; None for non-dict values.
Sourcepub fn dict_set(&mut self, key: String, value: Value) -> bool
pub fn dict_set(&mut self, key: String, value: Value) -> bool
Set a key in a Dict (case-insensitive replace) or append it.
Returns true when this value is a dict and the key was written;
false when called on a non-dict (nothing is mutated).
Sourcepub fn param(name: impl Into<String>) -> Self
pub fn param(name: impl Into<String>) -> Self
Construct an unlocated named parameter placeholder.
Sourcepub fn param_with_span(name: impl Into<String>, span: Span) -> Self
pub fn param_with_span(name: impl Into<String>, span: Span) -> Self
Construct a located named parameter placeholder.
Sourcepub fn positional_param(idx: usize) -> Self
pub fn positional_param(idx: usize) -> Self
Construct an unlocated positional parameter placeholder.
Sourcepub fn positional_param_with_span(idx: usize, span: Span) -> Self
pub fn positional_param_with_span(idx: usize, span: Span) -> Self
Construct a located positional parameter placeholder.
Sourcepub fn param_name(&self) -> Option<&str>
pub fn param_name(&self) -> Option<&str>
Extract the parameter name if this is a named parameter.
Sourcepub fn param_span(&self) -> Option<Span>
pub fn param_span(&self) -> Option<Span>
Extract the parameter source span if present.