PostgresTypes

Enum PostgresTypes 

Source
pub enum PostgresTypes {
Show 58 variants SmallInt, Integer, BigInt, Decimal, Real, DoublePrecision, Numeric, SmallSerial, Serial, BigSerial, Money, VarChar, CharVarying, CharacterVarying, Char, Character, Text, ByteA, Timestamp, TimestampWithoutTimeZone, TimestampWithTimeZone, Date, Time, TimeWithoutTimeZone, TimeWithTimeZone, Interval, Boolean, Enum, Point, Line, Lseg, Box, Path, PathOpen, Polygon, Circle, Inet, Cidr, MacAddr, MacAddr8, Bit, BitVarying, TsVector, TsQuery, Xml, Json, JsonB, Uuid, PgLsn, PgSnapshot, TxidSnapshot, Int4Range, Int8Range, NumRange, TsRange, TstzRange, DateRange, Array(Box<PostgresTypes>),
}
Expand description

The PostgreSQL data types are used to define a type of a column of a table. In addition, a column can be defined as a computed column, using an expression that evaluates to a value of scalar type.

  • https://www.postgresql.org/docs/12/datatype.html

Variants§

§

SmallInt

A 2 byte signed integer.

  • Range: -32768 to +32767
  • Storage Size: 2 bytes
  • Category: Numeric
  • SQL Type: SMALLINT
  • Alias: INT2
  • Note: The smallint type is generally only used if disk space is at a premium. Otherwise, integer should be used.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-SMALLINT
§

Integer

A 4 byte signed integer.

  • Range: -2147483648 to +2147483647
  • Storage Size: 4 bytes
  • Category: Numeric
  • SQL Type: INTEGER
  • Alias: INT, INT4
  • Note: The integer type is generally the default choice when you need to store a number.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-INTEGER
§

BigInt

An 8 byte signed integer.

  • Range: -9223372036854775808 to +9223372036854775807
  • Storage Size: 8 bytes
  • Category: Numeric
  • SQL Type: BIGINT
  • Alias: INT8
  • Note: The bigint type should be used if you need to store numbers outside the range of the integer type.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-BIGINT
§

Decimal

A fixed precision number.

  • Range: -10^38 +1 to 10^38 -1
  • Storage Size: 4 bytes
  • Category: Numeric
  • SQL Type: DECIMAL
  • Alias: DEC, NUMERIC, FIXED
  • Note: The precision, p, can be from 1 to 38. The scale, s, can be from 0 to p.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-DECIMAL
§

Real

A 4 byte floating point number.

  • Range: 6 decimal digits precision
  • Storage Size: 4 bytes
  • Category: Numeric
  • SQL Type: REAL
  • Alias: FLOAT4
  • Note: The real type typically has a range of around 6 decimal digits of precision.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-FLOAT
§

DoublePrecision

An 8 byte floating point number.

  • Range: 15 decimal digits precision
  • Storage Size: 8 bytes
  • Category: Numeric
  • SQL Type: DOUBLE PRECISION
  • Alias: FLOAT8
  • Note: The double precision type typically has a range of around 15 decimal digits of precision.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-FLOAT
§

Numeric

A variable precision number.

  • Range: 15 decimal digits precision
  • Storage Size: 8 bytes
  • Category: Numeric
  • SQL Type: NUMERIC
  • Alias: NUMERIC, DEC, DECIMAL, FIXED
  • Note: The numeric type can store numbers with very large numbers of digits. It is especially recommended for storing monetary amounts and other quantities where exactness is required.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-NUMERIC
§

SmallSerial

A 1 byte signed integer.

  • Range: -128 to +127
  • Storage Size: 1 byte
  • Category: Numeric
  • SQL Type: SMALLINT
  • Alias: INT2
  • Note: The smallserial type is generally only used if disk space is at a premium. Otherwise, serial should be used.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-SERIAL
§

Serial

A 4 byte signed integer.

  • Range: 1 to 2147483647
  • Storage Size: 4 bytes
  • Category: Numeric
  • SQL Type: INTEGER
  • Alias: INT, INT4
  • Note: The serial type is generally the default choice when you need to store a number.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-SERIAL
§

BigSerial

An 8 byte signed integer.

  • Range: 1 to 9223372036854775807
  • Storage Size: 8 bytes
  • Category: Numeric
  • SQL Type: BIGINT
  • Alias: INT8
  • Note: The bigserial type should be used if you need to store numbers outside the range of the integer type.
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-SERIAL
§

Money

A 8 byte currency amount.

  • Range: -92233720368547758.08 to +92233720368547758.07
  • Storage Size: 8 bytes
  • Category: Monetary
  • SQL Type: MONEY
  • Alias: -
  • Note: The money type stores a currency amount with a fixed fractional precision.
  • https://www.postgresql.org/docs/12/datatype-money.html
  • https://www.postgresql.org/docs/12/datatype-numeric.html#DATATYPE-MONEY
§

VarChar

A variable length character string.

  • Range: 1 to 10485760
  • Storage Size: 1 byte + the actual string
  • Category: Character
  • SQL Type: VARCHAR
  • Alias: CHAR VARYING
  • Note: The varchar type is used when you want to store a string that can be up to 10485760 bytes long.
  • https://www.postgresql.org/docs/12/datatype-character.html#DATATYPE-VARCHAR
§

CharVarying

A variable length character string.

  • Range: 1 to 10485760
  • Storage Size: 1 byte + the actual string
  • Category: Character
  • SQL Type: VARCHAR
  • Alias: CHAR VARYING
  • Note: The varchar type is used when you want to store a string that can be up to 10485760 bytes long.
  • https://www.postgresql.org/docs/12/datatype-character.html#DATATYPE-VARCHAR
§

CharacterVarying

A variable length character string.

  • Range: 1 to 10485760
  • Storage Size: 1 byte + the actual string
  • Category: Character
  • SQL Type: VARCHAR
  • Alias: CHAR VARYING
  • Note: The varchar type is used when you want to store a string that can be up to 10485760 bytes long.
  • https://www.postgresql.org/docs/12/datatype-character.html#DATATYPE-VARCHAR
§

Char

A fixed length character string.

  • Range: 1 to 10485760
  • Storage Size: 1 byte + the actual string
  • Category: Character
  • SQL Type: CHAR
  • Alias: CHARACTER
  • Note: The char type is used when you want to store a string that is exactly n characters long.
  • https://www.postgresql.org/docs/12/datatype-character.html#DATATYPE-CHAR
§

Character

A fixed length character string.

  • Range: 1 to 10485760
  • Storage Size: 1 byte + the actual string
  • Category: Character
  • SQL Type: CHAR
  • Alias: CHARACTER
  • Note: The char type is used when you want to store a string that is exactly n characters long.
  • https://www.postgresql.org/docs/12/datatype-character.html#DATATYPE-CHAR
§

Text

An unlimited length character string.

  • Range: 1 to 1073741824
  • Storage Size: 4 bytes + the actual string
  • Category: Character
  • SQL Type: TEXT
  • Alias: -
  • Note: The text type is used when you want to store a string with no limit on its length.
  • https://www.postgresql.org/docs/12/datatype-character.html#DATATYPE-TEXT
§

ByteA

A variable length binary string.

  • Range: 1 to 10485760
  • Storage Size: 4 bytes + the actual string
  • Category: Binary
  • SQL Type: BYTEA
  • Alias: -
  • Note: The bytea type is used when you want to store a string of bytes.
  • https://www.postgresql.org/docs/12/datatype-binary.html#DATATYPE-BYTEA
§

Timestamp

Both date and time (no time zone).

  • Range: 4713 BC to 294276 AD
  • Storage Size: 8 bytes
  • Category: Date/Time
  • SQL Type: TIMESTAMP
  • Alias: -
  • Note: The timestamp type is used when you want to store a date and time.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-TIMESTAMP
§

TimestampWithoutTimeZone

Both date and time (no time zone).

  • Range: 4713 BC to 294276 AD
  • Storage Size: 8 bytes
  • Category: Date/Time
  • SQL Type: TIMESTAMP
  • Alias: -
  • Note: The timestamp type is used when you want to store a date and time.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-TIMESTAMP
§

TimestampWithTimeZone

Both date and time (with time zone).

  • Range: 4713 BC to 294276 AD
  • Storage Size: 8 bytes
  • Category: Date/Time
  • SQL Type: TIMESTAMP WITH TIME ZONE
  • Alias: TIMESTAMPTZ
  • Note: The timestamptz type is used when you want to store a date and time with timezone information.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-TIMESTAMP-TIMEZONE
§

Date

Date (no time of day).

  • Range: 4713 BC to 5874897 AD
  • Storage Size: 4 bytes
  • Category: Date/Time
  • SQL Type: DATE
  • Alias: -
  • Note: The date type is used when you want to store a date only.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-DATE
§

Time

Time of day (no date).

  • Range: 00:00:00 to 24:00:00
  • Storage Size: 8 bytes
  • Category: Date/Time
  • SQL Type: TIME
  • Alias: -
  • Note: The time type is used when you want to store a time of day only.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-TIME
§

TimeWithoutTimeZone

Time of day (no date).

  • Range: 00:00:00 to 24:00:00
  • Storage Size: 8 bytes
  • Category: Date/Time
  • SQL Type: TIME
  • Alias: -
  • Note: The time type is used when you want to store a time of day only.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-TIME
§

TimeWithTimeZone

Time of day (with time zone).

  • Range: 00:00:00+1459 to 24:00:00-1459
  • Storage Size: 12 bytes
  • Category: Date/Time
  • SQL Type: TIME WITH TIME ZONE
  • Alias: TIMETZ
  • Note: The timetz type is used when you want to store a time of day with timezone information.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-TIME-TIMEZONE
§

Interval

A time span.

  • Range: -178000000 years to 178000000 years
  • Storage Size: 16 bytes
  • Category: Date/Time
  • SQL Type: INTERVAL
  • Alias: -
  • Note: The interval type is used when you want to store a time span.
  • https://www.postgresql.org/docs/12/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
§

Boolean

State of true or false.

  • Range: true or false
  • Storage Size: 1 byte
  • Category: Boolean
  • SQL Type: BOOLEAN
  • Alias: BOOL
  • Note: The boolean type is used when you want to store a state of true or false.
  • https://www.postgresql.org/docs/12/datatype-boolean.html#DATATYPE-BOOLEAN-BOOL
§

Enum

Enumerated (enum) types are data types that comprise a static, ordered set of values.

  • Range: -
  • Storage Size: 4 bytes
  • Category: Enum
  • SQL Type: ENUM
  • Alias: -
  • Note: The enum type is used when you want to store a static, ordered set of values.
  • https://www.postgresql.org/docs/12/datatype-enum.html#DATATYPE-ENUM
§

Point

A point on a plane.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Geometric
  • SQL Type: POINT
  • Alias: -
  • Note: The point type is used when you want to store a point on a plane.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-POINT
§

Line

Infinite line.

  • Range: -
  • Storage Size: 32 bytes
  • Category: Geometric
  • SQL Type: LINE
  • Alias: -
  • Note: The line type is used when you want to store an infinite line.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-LINE
§

Lseg

Finite line segment.

  • Range: -
  • Storage Size: 32 bytes
  • Category: Geometric
  • SQL Type: LSEG
  • Alias: -
  • Note: The lseg type is used when you want to store a finite line segment.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-LSEG
§

Box

Rectangular box on a plane.

  • Range: -
  • Storage Size: 32 bytes
  • Category: Geometric
  • SQL Type: BOX
  • Alias: -
  • Note: The box type is used when you want to store a rectangular box on a plane.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-BOX
§

Path

Closed path on a plane.

  • Range: -
  • Storage Size: 16+16n bytes
  • Category: Geometric
  • SQL Type: PATH
  • Alias: -
  • Note: The path type is used when you want to store a closed path on a plane.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-PATH
§

PathOpen

Open path on a plane.

  • Range: -
  • Storage Size: 16+16n bytes
  • Category: Geometric
  • SQL Type: PATH
  • Alias: -
  • Note: The path type is used when you want to store a open path on a plane.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-PATH
§

Polygon

Polygon on a plane.

  • Range: -
  • Storage Size: 40+16n bytes
  • Category: Geometric
  • SQL Type: POLYGON
  • Alias: -
  • Note: The polygon type is used when you want to store a polygon on a plane.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-POLYGON
§

Circle

Circle on a plane.

  • Range: -
  • Storage Size: 24 bytes
  • Category: Geometric
  • SQL Type: CIRCLE
  • Alias: -
  • Note: The circle type is used when you want to store a circle on a plane.
  • https://www.postgresql.org/docs/12/datatype-geometric.html#DATATYPE-CIRCLE
§

Inet

IPv4 or IPv6 host address.

  • Range: -
  • Storage Size: 12 bytes
  • Category: Network Address
  • SQL Type: INET
  • Alias: -
  • Note: The inet type is used when you want to store an IPv4 or IPv6 host address.
  • https://www.postgresql.org/docs/12/datatype-net-types.html#DATATYPE-INET
§

Cidr

IPv4 or IPv6 host address (without netmask).

  • Range: -
  • Storage Size: 12 bytes
  • Category: Network Address
  • SQL Type: CIDR
  • Alias: -
  • Note: The cidr type is used when you want to store an IPv4 or IPv6 host address (without netmask).
  • https://www.postgresql.org/docs/12/datatype-net-types.html#DATATYPE-CIDR
§

MacAddr

The essential difference between the cidr and inet types is that the former stores an address/netmask pair per value, and the latter stores a single address from the pair.

  • Range: -
  • Storage Size: 24 bytes
  • Category: Network Address
  • SQL Type: MACADDR
  • Alias: -
  • Note: The macaddr type is used when you want to store a MAC address.
  • https://www.postgresql.org/docs/12/datatype-net-types.html#DATATYPE-MACADDR
§

MacAddr8

The macaddr8 type is used when you want to store a MAC address (EUI-64 format).

  • Range: -
  • Storage Size: 8 bytes
  • Category: Network Address
  • SQL Type: MACADDR8
  • Alias: -
  • Note: The macaddr8 type is used when you want to store a MAC address (EUI-64 format).
  • https://www.postgresql.org/docs/12/datatype-net-types.html#DATATYPE-MACADDR8
§

Bit

Bit strings are strings of 1’s and 0’s.

  • Range: -
  • Storage Size: 1 or 4 bytes + 1 byte for each 8 bits
  • Category: Bit String
  • SQL Type: BIT
  • Alias: -
  • Note: The bit type is used when you want to store a bit string.
  • https://www.postgresql.org/docs/12/datatype-bit.html#DATATYPE-BIT
§

BitVarying

Bit strings are strings of 1’s and 0’s.

  • Range: -
  • Storage Size: 1 or 4 bytes + 1 byte for each 8 bits
  • Category: Bit String
  • SQL Type: BIT VARYING
  • Alias: VARBIT
  • Note: The bit varying type is used when you want to store a bit string with a length limit.
  • https://www.postgresql.org/docs/12/datatype-bit.html#DATATYPE-BIT-VARYING
§

TsVector

Text search document.

  • Range: -
  • Storage Size: -
  • Category: Text Search
  • SQL Type: TSVECTOR
  • Alias: -
  • Note: The tsvector type is used to store a document in a format optimized for text search.
  • https://www.postgresql.org/docs/12/datatype-textsearch.html#DATATYPE-TSVECTOR
§

TsQuery

Text search query.

  • Range: -
  • Storage Size: -
  • Category: Text Search
  • SQL Type: TSQUERY
  • Alias: -
  • Note: The tsquery type is used to store a text search query.
  • https://www.postgresql.org/docs/12/datatype-textsearch.html#DATATYPE-TSQUERY
§

Xml

XML data.

  • Range: -
  • Storage Size: 4 bytes + the actual binary string
  • Category: XML
  • SQL Type: XML
  • Alias: -
  • Note: The xml type is used to store XML data.
  • https://www.postgresql.org/docs/12/datatype-xml.html#DATATYPE-XML
§

Json

JSON data.

  • Range: -
  • Storage Size: 1 byte + the actual binary string
  • Category: JSON
  • SQL Type: JSON
  • Alias: -
  • Note: The json type stores an exact copy of the input text, which processing functions must reparse on each execution; while jsonb data is stored in a decomposed binary format that makes it slightly slower to input due to added conversion overhead, but significantly faster to process, since no reparsing is needed. jsonb also supports indexing, which can be a significant advantage.
  • https://www.postgresql.org/docs/12/datatype-json.html#DATATYPE-JSON
§

JsonB

Binary JSON data, decomposed.

  • Range: -
  • Storage Size: 1 byte + the actual binary string
  • Category: JSON
  • SQL Type: JSONB
  • Alias: -
  • Note: The json type stores an exact copy of the input text, which processing functions must reparse on each execution; while jsonb data is stored in a decomposed binary format that makes it slightly slower to input due to added conversion overhead, but significantly faster to process, since no reparsing is needed. jsonb also supports indexing, which can be a significant advantage.
  • https://www.postgresql.org/docs/12/datatype-json.html#DATATYPE-JSONB
§

Uuid

UUID datatype.

  • Range: 0 to 2^128-1
  • Storage Size: 16 bytes
  • Category: UUID
  • SQL Type: UUID
  • Alias: -
  • Note: The uuid type stores Universally Unique Identifiers (UUID) as defined by RFC 4122, ISO/IEC 9834-8:2005, and related standards. (A Universally Unique Identifier (UUID) URN Namespace, P. Leach, M. Mealling, R. Salz, December 2005.)
  • https://www.postgresql.org/docs/12/datatype-uuid.html#DATATYPE-UUID
§

PgLsn

The pg_lsn type is used to store LSN (Log Sequence Number) values, as used in WAL (Write-Ahead Log) records.

  • Range: 0 to 2^64-1
  • Storage Size: 8 bytes
  • Category: LSN
  • SQL Type: PG_LSN
  • Alias: -
  • Note: The pg_lsn type is used to store LSN (Log Sequence Number) values, as used in WAL (Write-Ahead Log) records.
  • https://www.postgresql.org/docs/12/datatype-pg-lsn.html#DATATYPE-PG-LSN
§

PgSnapshot

The pg_snapshot type is used to store snapshot information for use by the txid_current_snapshot() function.

  • Range: -
  • Storage Size: 8 bytes
  • Category: Snapshot
  • SQL Type: PG_SNAPSHOT
  • Alias: -
  • Note: The pg_snapshot type is used to store snapshot information for use by the txid_current_snapshot() function.
  • https://www.postgresql.org/docs/12/datatype-pg-snapshot.html#DATATYPE-PG-SNAPSHOT
§

TxidSnapshot

The txid_snapshot type is used to store transaction snapshot information for use by the txid_snapshot_in() and txid_snapshot_out() functions.

  • Range: -
  • Storage Size: 8 bytes
  • Category: Snapshot
  • SQL Type: TXID_SNAPSHOT
  • Alias: -
  • Note: The txid_snapshot type is used to store transaction snapshot information for use by the txid_snapshot_in() and txid_snapshot_out() functions.
  • https://www.postgresql.org/docs/12/datatype-pg-snapshot.html#DATATYPE-TXID-SNAPSHOT
§

Int4Range

Range of integer.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Range
  • SQL Type: INT4RANGE
  • Alias: -
  • Note: The int4range type is used to represent a range of integer values.
  • https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPES-INT4RANGE
§

Int8Range

Range of bigint.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Range
  • SQL Type: INT8RANGE
  • Alias: -
  • Note: The int8range type is used to represent a range of bigint values.
  • https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPES-INT8RANGE
§

NumRange

Range of numeric.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Range
  • SQL Type: NUMRANGE
  • Alias: -
  • Note: The numrange type is used to represent a range of numeric values.
  • https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPES-NUMRANGE
§

TsRange

Range of timestamp without time zone.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Range
  • SQL Type: TSRANGE
  • Alias: -
  • Note: The tsrange type is used to represent a range of timestamp without time zone values.
  • https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPES-TSRANGE
§

TstzRange

Range of timestamp with time zone.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Range
  • SQL Type: TSTZRANGE
  • Alias: -
  • Note: The tstzrange type is used to represent a range of timestamp with time zone values.
  • https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPES-TSTZRANGE
§

DateRange

Range of date.

  • Range: -
  • Storage Size: 16 bytes
  • Category: Range
  • SQL Type: DATERANGE
  • Alias: -
  • Note: The daterange type is used to represent a range of date values.
  • https://www.postgresql.org/docs/12/rangetypes.html#RANGETYPES-DATERANGE
§

Array(Box<PostgresTypes>)

Array of select types.

  • Range: -
  • Storage Size: 1 or 4 bytes + N * length of element type
  • Category: Array
  • SQL Type: _TYPE
  • Alias: -
  • Note: Arrays of any built-in or user-defined base type, enum type, or composite type can be created. Arrays of domains are not yet supported.
  • https://www.postgresql.org/docs/12/arrays.html#ARRAYS-DECLARATION

Implementations§

Source§

impl PostgresTypes

Source

pub fn category(&self) -> DataTypeCategory

Returns the DataTypeCategory corresponding to a specific PostgresTypes variant.

§Examples
use rustyroad::database::PostgresTypes;
use rustyroad::database::DataTypeCategory;

let data_type = PostgresTypes::Boolean;
let category = data_type.category();
assert_eq!(category, DataTypeCategory::Numeric);
Source

pub fn order_by_alphabetical_order(types: &mut Vec<PostgresTypes>)

Orders the types by alphabetical order.

§Examples
use rustyroad::database::PostgresTypes;

let mut types = vec![
    PostgresTypes::Text,
    PostgresTypes::Integer,
    PostgresTypes::Boolean,
];

PostgresTypes::order_by_alphabetical_order(&mut types);

assert_eq!(types, vec![
    PostgresTypes::Boolean,
    PostgresTypes::Integer,
    PostgresTypes::Text,
]);

Trait Implementations§

Source§

impl Clone for PostgresTypes

Source§

fn clone(&self) -> PostgresTypes

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PostgresTypes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PostgresTypes

Source§

fn default() -> PostgresTypes

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PostgresTypes

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for PostgresTypes

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Hash for PostgresTypes

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoEnumIterator for PostgresTypes

Source§

impl Ord for PostgresTypes

Source§

fn cmp(&self, other: &PostgresTypes) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for PostgresTypes

Source§

fn eq(&self, other: &PostgresTypes) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PostgresTypes

Source§

fn partial_cmp(&self, other: &PostgresTypes) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for PostgresTypes

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for PostgresTypes

Source§

impl StructuralPartialEq for PostgresTypes

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SectionExt for T
where T: Display + Send + Sync + 'static,

Source§

fn header<C>(self, header: C) -> IndentedSection<C, T>
where C: Display + Send + Sync + 'static,

Add a header to a Section and indent the body Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,