Enum pgrepr::Value [−][src]
pub enum Value {
Show 22 variants
Array {
dims: Vec<ArrayDimension>,
elements: Vec<Option<Value>>,
},
Bool(bool),
Bytea(Vec<u8>),
Date(NaiveDate),
Float4(f32),
Float8(f64),
Int2(i16),
Int4(i32),
Int8(i64),
Interval(Interval),
Jsonb(Jsonb),
List(Vec<Option<Value>>),
Map(BTreeMap<String, Option<Value>>),
Numeric(Numeric),
Record(Vec<Option<Value>>),
Time(NaiveTime),
Timestamp(NaiveDateTime),
TimestampTz(DateTime<Utc>),
Text(String),
Char {
inner: String,
length: Option<usize>,
},
VarChar(String),
Uuid(Uuid),
}
Expand description
A PostgreSQL datum.
Variants
Array
Fields
dims: Vec<ArrayDimension>
The dimensions of the array.
A variable-length, multi-dimensional array of values.
Bool(bool)
Tuple Fields
0: bool
A boolean value.
Bytea(Vec<u8>)
A byte array, i.e., a variable-length binary string.
Date(NaiveDate)
Tuple Fields
0: NaiveDate
A date.
Float4(f32)
Tuple Fields
0: f32
A 4-byte floating point number.
Float8(f64)
Tuple Fields
0: f64
An 8-byte floating point number.
Int2(i16)
Tuple Fields
0: i16
A 2-byte signed integer.
Int4(i32)
Tuple Fields
0: i32
A 4-byte signed integer.
Int8(i64)
Tuple Fields
0: i64
An 8-byte signed integer.
Interval(Interval)
Tuple Fields
0: Interval
A time interval.
Jsonb(Jsonb)
Tuple Fields
0: Jsonb
A binary JSON blob.
List(Vec<Option<Value>>)
A sequence of homogeneous values.
Map(BTreeMap<String, Option<Value>>)
A map of string keys and homogeneous values.
Numeric(Numeric)
Tuple Fields
0: Numeric
An arbitrary precision number.
Record(Vec<Option<Value>>)
A sequence of heterogeneous values.
Time(NaiveTime)
Tuple Fields
0: NaiveTime
A time.
Timestamp(NaiveDateTime)
Tuple Fields
A date and time, without a timezone.
TimestampTz(DateTime<Utc>)
A date and time, with a timezone.
Text(String)
Tuple Fields
0: String
A variable-length string.
Char
Fields
inner: String
The inner string; note that this is potentially trimmed
A fixed-length string.
VarChar(String)
Tuple Fields
0: String
A variable-length string with an optional limit.
Uuid(Uuid)
Tuple Fields
0: Uuid
A universally unique identifier.
Implementations
Constructs a new Value
from a Materialize datum.
The conversion happens in the obvious manner, except that Datum::Null
is converted to None
to align with how PostgreSQL handles NULL.
Converts a Materialize datum and type from this value.
To construct a null datum, see the null_datum
function.
Serializes this value to buf
in the specified format
.
Serializes this value to buf
using the text encoding
format.
Serializes this value to buf
using the binary encoding
format.
Deserializes a value of type ty
from raw
using the specified
format
.
Deserializes a value of type ty
from raw
using the text encoding
format.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more