pub enum Type {
Show 34 variants Array(Box<Type>), Bool, Bytea, Char, Date, Float4, Float8, Int2, Int4, Int8, UInt2, UInt4, UInt8, Interval { constraints: Option<IntervalConstraints>, }, Json, Jsonb, List(Box<Type>), Map { value_type: Box<Type>, }, Numeric { constraints: Option<NumericConstraints>, }, Oid, Record(Vec<Type>), Text, BpChar { length: Option<CharLength>, }, VarChar { max_length: Option<CharLength>, }, Time { precision: Option<TimePrecision>, }, TimeTz { precision: Option<TimePrecision>, }, Timestamp { precision: Option<TimestampPrecision>, }, TimestampTz { precision: Option<TimestampPrecision>, }, Uuid, RegProc, RegType, RegClass, Int2Vector, MzTimestamp,
}
Expand description

The type of a Value.

The Display representation of a type is guaranteed to be valid PostgreSQL syntax that names the type and any modifiers.

Variants

Array(Box<Type>)

A variable-length multidimensional array of values.

Bool

A boolean value.

Bytea

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

Char

A single-byte character.

Date

A date.

Float4

A 4-byte floating point number.

Float8

An 8-byte floating point number.

Int2

A 2-byte signed integer.

Int4

A 4-byte signed integer.

Int8

An 8-byte signed integer.

UInt2

A 2-byte unsigned integer. This does not exist in PostgreSQL.

UInt4

A 4-byte unsigned integer. This does not exist in PostgreSQL.

UInt8

An 8-byte unsigned integer. This does not exist in PostgreSQL.

Interval

Fields

constraints: Option<IntervalConstraints>

Optional constraints on the type.

A time interval.

Json

A textual JSON blob.

Jsonb

A binary JSON blob.

List(Box<Type>)

A sequence of homogeneous values.

Map

Fields

value_type: Box<Type>

The type of the values in the map.

A map with text keys and homogeneous values.

Numeric

Fields

constraints: Option<NumericConstraints>

Optional constraints on the type.

An arbitrary precision number.

Oid

An object identifier.

Record(Vec<Type>)

A sequence of heterogeneous values.

Text

A variable-length string.

BpChar

Fields

length: Option<CharLength>

The length of the string.

If unspecified, the type represents a variable-length string.

A (usually) fixed-length string.

VarChar

Fields

max_length: Option<CharLength>

An optional maximum length to enforce, in characters.

A variable-length string with an optional limit.

Time

Fields

precision: Option<TimePrecision>

An optional precision for the fractional digits in the second field.

A time of day without a day.

TimeTz

Fields

precision: Option<TimePrecision>

An optional precision for the fractional digits in the second field.

A time with a time zone.

Timestamp

Fields

precision: Option<TimestampPrecision>

An optional precision for the fractional digits in the second field.

A date and time, without a timezone.

TimestampTz

Fields

precision: Option<TimestampPrecision>

An optional precision for the fractional digits in the second field.

A date and time, with a timezone.

Uuid

A universally unique identifier.

RegProc

A function name.

RegType

A type name.

RegClass

A class name.

Int2Vector

A small int vector.

MzTimestamp

A Materialize timestamp.

Implementations

Returns the type corresponding to the provided OID, if the OID is known.

Returns the Type corresponding to the provided OID and packed type modifier (“typmod”).

For details about typmods, see the typmod method.

Errors

Returns an error if the OID is unknown or if the typmod is invalid for the type.

Returns the item’s name in a way that guarantees it’s resolvable in the catalog.

Returns the user-friendly name that PostgreSQL uses for this type.

Returns the OID of this type.

Returns the constraint on the type, if any.

Returns the number of bytes in the binary representation of this type, or -1 if the type has a variable-length representation.

Returns the packed type modifier (“typmod”) for the type.

The typmod is a 32-bit integer associated with the type that encodes optional constraints on the type. For example, the typmod on Type::VarChar encodes an optional constraint on the value’s length. Most types are never associated with a typmod.

Negative typmods indicate no constraint.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type returned in the event of a conversion error.
Performs the conversion.

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
Formats an object with the “alternative” format ({:#}) and returns it.
Compare self to key and return true if they are equal.

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
Upcasts this ProgressEventTimestamp to Any. Read more
Returns the name of the concrete type of this object. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
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