[][src]Enum pg_wire::PgType

pub enum PgType {
    SmallInt,
    Integer,
    BigInt,
    Char,
    VarChar,
    Bool,
}

Represents PostgreSQL data type and methods to send over wire

Variants

SmallInt

Represents PostgreSQL smallint data type

Integer

Represents PostgreSQL integer (or int) data type

BigInt

Represents PostgreSQL bigint data type

Char

Represents PostgreSQL character(n) (or char(n)) data type

VarChar

Represents PostgreSQL character varying(n) (or varchar(n)) data type

Bool

Represents PostgreSQL boolean data type

Implementations

impl PgType[src]

pub fn type_oid(&self) -> Oid[src]

Returns PostgreSQL type Oid

pub fn type_len(&self) -> i16[src]

Returns PostgreSQL type length

pub fn decode(&self, format: &PgFormat, raw: &[u8]) -> Result<Value, String>[src]

Deserializes a value of this type from raw using the specified format.

pub fn from_oid(oid: Oid) -> Result<Option<PgType>, NotSupportedOid>[src]

Returns the type corresponding to the provided Oid, if the it is known.

Trait Implementations

impl Clone for PgType[src]

impl Copy for PgType[src]

impl Debug for PgType[src]

impl Display for PgType[src]

impl PartialEq<PgType> for PgType[src]

impl StructuralPartialEq for PgType[src]

Auto Trait Implementations

impl RefUnwindSafe for PgType

impl Send for PgType

impl Sync for PgType

impl Unpin for PgType

impl UnwindSafe for PgType

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.