pub enum Value {
Show 29 variants Array { dims: Vec<ArrayDimension>, elements: Vec<Option<Value>>, }, Bool(bool), Bytea(Vec<u8>), Char(u8), Date(Date), Float4(f32), Float8(f64), Int2(i16), Int4(i32), Int8(i64), UInt2(u16), UInt4(u32), UInt8(u64), Interval(Interval), Jsonb(Jsonb), List(Vec<Option<Value>>), Map(BTreeMap<String, Option<Value>>), Numeric(Numeric), Oid(u32), Record(Vec<Option<Value>>), Time(NaiveTime), Timestamp(CheckedTimestamp<NaiveDateTime>), TimestampTz(CheckedTimestamp<DateTime<Utc>>), Text(String), BpChar(String), VarChar(String), Uuid(Uuid), Int2Vector { elements: Vec<Option<Value>>, }, MzTimestamp(Timestamp),
}
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)

A boolean value.

Bytea(Vec<u8>)

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

Char(u8)

A single-byte character.

Date(Date)

A date.

Float4(f32)

A 4-byte floating point number.

Float8(f64)

An 8-byte floating point number.

Int2(i16)

A 2-byte signed integer.

Int4(i32)

A 4-byte signed integer.

Int8(i64)

An 8-byte signed integer.

UInt2(u16)

A 2-byte unsigned integer.

UInt4(u32)

A 4-byte unsigned integer.

UInt8(u64)

An 8-byte unsigned integer.

Interval(Interval)

A time interval.

Jsonb(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)

An arbitrary precision number.

Oid(u32)

An object identifier.

Record(Vec<Option<Value>>)

A sequence of heterogeneous values.

Time(NaiveTime)

A time.

Timestamp(CheckedTimestamp<NaiveDateTime>)

A date and time, without a timezone.

TimestampTz(CheckedTimestamp<DateTime<Utc>>)

A date and time, with a timezone.

Text(String)

A variable-length string.

BpChar(String)

A fixed-length string.

VarChar(String)

A variable-length string with an optional limit.

Uuid(Uuid)

A universally unique identifier.

Int2Vector

Fields

elements: Vec<Option<Value>>

The elements of the vector.

A small int vector.

MzTimestamp(Timestamp)

A Materialize timestamp.

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 from this value.

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

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
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