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.

elements: Vec<Option<Value>>

The elements of the array.

A variable-length, multi-dimensional array of values.

Bool(bool)

Tuple Fields

0: bool

A boolean value.

Bytea(Vec<u8>)

Tuple Fields

0: Vec<u8>

A byte array, i.e., a variable-length binary string.

Date(NaiveDate)

Tuple Fields

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

A time interval.

Jsonb(Jsonb)

Tuple Fields

0: Jsonb

A binary JSON blob.

List(Vec<Option<Value>>)

Tuple Fields

A sequence of homogeneous values.

Map(BTreeMap<String, Option<Value>>)

Tuple Fields

A map of string keys and homogeneous values.

Numeric(Numeric)

Tuple Fields

An arbitrary precision number.

Record(Vec<Option<Value>>)

Tuple Fields

A sequence of heterogeneous values.

Time(NaiveTime)

Tuple Fields

A time.

Timestamp(NaiveDateTime)

Tuple Fields

A date and time, without a timezone.

TimestampTz(DateTime<Utc>)

Tuple Fields

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

length: Option<usize>

The fixed length of the string

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.

Deserializes a value of type ty from raw using the binary encoding format.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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