pub enum Value {
Show 31 variants
I32(i32),
I64(i64),
F64(f64),
Text(String),
Bool(bool),
Bytes(Vec<u8>),
NullI32,
NullI64,
NullF64,
NullText,
NullBool,
NullBytes,
Timestamptz(DateTime<Utc>),
NullTimestamptz,
Date(NaiveDate),
NullDate,
Uuid(Uuid),
NullUuid,
Numeric(Decimal),
NullNumeric,
TextArray(Vec<String>),
NullTextArray,
IntegerArray(Vec<i32>),
NullIntegerArray,
BigIntArray(Vec<i64>),
NullBigIntArray,
UuidArray(Vec<Uuid>),
NullUuidArray,
Json(Value),
NullJson,
Placeholder(&'static str),
}Expand description
A closed, non-generic sum of every literal value the crate can bind as a
query parameter. Deliberately not Box<dyn ToSql>: a plain enum keeps
the renderer free of vtable dispatch and lets it stay a single
non-generic function no matter how many query shapes exist.
Variants§
I32(i32)
I64(i64)
F64(f64)
Text(String)
Bool(bool)
Bytes(Vec<u8>)
NullI32
A NULL of a specific base type, not a single untyped Null: a
Postgres bind declares a parameter type even when the value is NULL,
and a mismatched one can fail query planning. Each NullX variant
lets the execution layer bind Option::<X>::None with the right
type.
NullI64
NullF64
NullText
NullBool
NullBytes
Timestamptz(DateTime<Utc>)
NullTimestamptz
Date(NaiveDate)
NullDate
Uuid(Uuid)
NullUuid
Numeric(Decimal)
NullNumeric
TextArray(Vec<String>)
Postgres array values: a Vec<T> binds as T[], one variant per
element type.
NullTextArray
IntegerArray(Vec<i32>)
NullIntegerArray
BigIntArray(Vec<i64>)
NullBigIntArray
UuidArray(Vec<Uuid>)
NullUuidArray
Json(Value)
A JSON document, opaque to this crate: it binds and decodes, and the
operators that look inside one go through sql!{}.
NullJson
Placeholder(&'static str)
A named placeholder in a prepare!{}-built query, not yet resolved
to a concrete value. It rides the existing Vec<Value> parameter
pipeline: rendering doesn’t care what’s inside a Value, only that
there’s one per placeholder position. select::Prepared substitutes
real values before binding.