#[non_exhaustive]pub enum PgType {
Show 16 variants
Boolean,
Smallint,
Integer,
Bigint,
Numeric,
Text,
Varchar,
Bpchar,
Date,
Timestamp,
TimestampTz,
Time,
TimeTz,
Jsonb,
Interval,
Uuid,
}Expand description
A type PostgreSQL names in a cast’s error, printed as format_type names it.
use sql_values::postgres::{DateTimeError, PgType};
assert_eq!(PgType::Time.to_string(), "time without time zone");
// `time_in` names the type `time` in its syntax error.
let error = DateTimeError::InvalidInputSyntax(PgType::Time);
assert_eq!(error.to_string(), "invalid input syntax for type time");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Boolean
boolean.
Smallint
smallint.
Integer
integer.
Bigint
bigint.
Numeric
numeric.
Text
text.
Varchar
character varying.
Bpchar
character.
Date
date.
Timestamp
timestamp without time zone.
TimestampTz
timestamp with time zone.
Time
time without time zone.
TimeTz
time with time zone.
Jsonb
jsonb.
Interval
interval.
Uuid
uuid.
Trait Implementations§
impl Copy for PgType
impl Eq for PgType
Source§impl From<IntegerType> for PgType
impl From<IntegerType> for PgType
Source§fn from(integer: IntegerType) -> Self
fn from(integer: IntegerType) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for PgType
Auto Trait Implementations§
impl Forget for PgType
impl Freeze for PgType
impl Move for PgType
impl RefUnwindSafe for PgType
impl Send for PgType
impl Sync for PgType
impl Unpin for PgType
impl UnsafeUnpin for PgType
impl UnwindSafe for PgType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more