Enum Type

Source
pub enum Type {
Show 51 variants SmallInt, Integer, BigInt, Decimal(ArbitraryPrecisionNumericAttr), Numeric(ArbitraryPrecisionNumericAttr), Real, DoublePrecision, SmallSerial, Serial, BigSerial, Money, Varchar(StringAttr), Char(StringAttr), Text, Bytea, Timestamp(TimeAttr), TimestampWithTimeZone(TimeAttr), Date, Time(TimeAttr), TimeWithTimeZone(TimeAttr), Interval(IntervalAttr), Boolean, Point, Line, Lseg, Box, Path, Polygon, Circle, Cidr, Inet, MacAddr, MacAddr8, Bit(BitAttr), VarBit(BitAttr), TsVector, TsQuery, Uuid, Xml, Json, JsonBinary, Array(ArrayDef), Int4Range, Int8Range, NumRange, TsRange, TsTzRange, DateRange, PgLsn, Unknown(String), Enum(EnumDef),
}
Available on crate features postgres and def only.
Expand description

All built-in types of PostgreSQL, excluding synonyms

Variants§

§

SmallInt

16 bit integer

§

Integer

32 bit integer

§

BigInt

64 bit integer

§

Decimal(ArbitraryPrecisionNumericAttr)

User-specified precision number

§

Numeric(ArbitraryPrecisionNumericAttr)

User-specified precision number

§

Real

32 bit floating-point

§

DoublePrecision

64 bit floating-point

§

SmallSerial

16 bit autoincrementing integer

§

Serial

32 bit autoincrementing integer

§

BigSerial

64 bit autoincrementing integer

§

Money

Currency amount; 64 bits with a fractional precision determined by the database’s lc_monetary setting

§

Varchar(StringAttr)

Variable-length character array with limit

§

Char(StringAttr)

Fixed-length character array; blank padded

§

Text

Variable, unlimited length character array

§

Bytea

Variable length binary string

§

Timestamp(TimeAttr)

Date and time

§

TimestampWithTimeZone(TimeAttr)

§

Date

Date without time of day

§

Time(TimeAttr)

Time without date

§

TimeWithTimeZone(TimeAttr)

§

Interval(IntervalAttr)

Time interval

§

Boolean

One byte boolean value

§

Point

Point on a plane

§

Line

Infinite line

§

Lseg

Finite line segment

§

Box

Rectangular box

§

Path

Closed or open path

§

Polygon

Polygon (similar to a closed path)

§

Circle

Circle composed of a center point and radius

§

Cidr

IPv4 and IPv6 networks

§

Inet

IPPv4 and IPv6 hosts and networks

§

MacAddr

6 byte MAC address

§

MacAddr8

8 byte MAC address in EUI-64 format

§

Bit(BitAttr)

Fixed length bit string

§

VarBit(BitAttr)

Variable length bit string

§

TsVector

A sorted list of distinct lexemes which are words that have been normalized to merge different variants of the same word

§

TsQuery

A list of lexemes that are to be searched for, and can be combined using Boolean operators AND, OR, and NOT, as well as a phrase search operation

§

Uuid

A universally unique identifier as defined by RFC 4122, ISO 9834-8:2005, and related standards

§

Xml

XML data checked for well-formedness and with additional support functions

§

Json

JSON data checked for validity and with additional functions

§

JsonBinary

JSON data stored in a decomposed binary format that can be subscripted and used in indexes

§

Array(ArrayDef)

Variable-length multidimensional array

§

Int4Range

Range of an integer

§

Int8Range

Range of a bigint

§

NumRange

Range of a numeric

§

TsRange

Range of a timestamp without time zone

§

TsTzRange

Range of a timestamp with time zone

§

DateRange

Range of a date

§

PgLsn

A log sequence number

§

Unknown(String)

§

Enum(EnumDef)

Defines an PostgreSQL

Implementations§

Source§

impl Type

Source

pub fn from_str( column_type: &str, udt_name: Option<&str>, is_enum: bool, ) -> Type

Source§

impl Type

Source

pub fn has_numeric_attr(&self) -> bool

Source

pub fn has_string_attr(&self) -> bool

Source

pub fn has_time_attr(&self) -> bool

Source

pub fn has_interval_attr(&self) -> bool

Source

pub fn has_bit_attr(&self) -> bool

Source

pub fn has_enum_attr(&self) -> bool

Source

pub fn has_array_attr(&self) -> bool

Trait Implementations§

Source§

impl Clone for Type

Source§

fn clone(&self) -> Type

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 Type

Source§

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

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

impl PartialEq for Type

Source§

fn eq(&self, other: &Type) -> 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 StructuralPartialEq for Type

Auto Trait Implementations§

§

impl Freeze for Type

§

impl RefUnwindSafe for Type

§

impl !Send for Type

§

impl !Sync for Type

§

impl Unpin for Type

§

impl UnwindSafe for Type

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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.