Enum pgrepr::Type[][src]

pub enum Type {
Show 26 variants Array(Box<Type>), Bool, Bytea, Date, Float4, Float8, Int2, Int4, Int8, Interval, Jsonb, List(Box<Type>), Map { value_type: Box<Type>, }, Numeric, Oid, Record(Vec<Type>), Text, Char, VarChar, Time, Timestamp, TimestampTz, Uuid, RegProc, RegType, RegClass,
}
Expand description

The type of a Value.

Variants

Array(Box<Type>)

Tuple Fields

0: Box<Type>

A variable-length multidimensional array of values.

Bool

A boolean value.

Bytea

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

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.

Interval

A time interval.

Jsonb

A binary JSON blob.

List(Box<Type>)

Tuple Fields

0: 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

An arbitrary precision number.

Oid

An object identifier.

Record(Vec<Type>)

Tuple Fields

0: Vec<Type>

A sequence of heterogeneous values.

Text

A variable-length string.

Char

A fixed-length string.

VarChar

A variable-length string with an optional limit.

Time

A time of day without a day.

Timestamp

A date and time, without a timezone.

TimestampTz

A date and time, with a timezone.

Uuid

A universally unique identifier.

RegProc

A function name.

RegType

A type name.

RegClass

A class name.

Implementations

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

Returns the name that PostgreSQL uses for this type.

Returns the OID of this type.

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

Provides a ScalarType from self, but without necessarily associating any meaningful values within the returned type.

For example Type::Numeric returns SScalarType::Numeric { scale: None }, meaning that its scale might need values from elsewhere.

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

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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