pub struct PgTypeInfo(/* private fields */);
Available on crate feature
postgres
only.Expand description
Type information for a PostgreSQL type.
Implementationsยง
Sourceยงimpl PgTypeInfo
impl PgTypeInfo
Sourcepub fn kind(&self) -> &PgTypeKind
pub fn kind(&self) -> &PgTypeKind
Returns the kind (simple, array, enum, etc.) for this type.
Sourcepub const fn with_name(name: &'static str) -> PgTypeInfo
pub const fn with_name(name: &'static str) -> PgTypeInfo
Create a PgTypeInfo
from a type name.
The OID for the type will be fetched from Postgres on use of a value of this type. The fetched OID will be cached per-connection.
Sourcepub const fn with_oid(oid: Oid) -> PgTypeInfo
pub const fn with_oid(oid: Oid) -> PgTypeInfo
Create a PgTypeInfo
from an OID.
Note that the OID for a type is very dependent on the environment. If you only ever use
one database or if this is an unhandled built-in type, you should be fine. Otherwise,
you will be better served using with_name
.
Trait Implementationsยง
Sourceยงimpl Clone for PgTypeInfo
impl Clone for PgTypeInfo
Sourceยงfn clone(&self) -> PgTypeInfo
fn clone(&self) -> PgTypeInfo
Returns a copy of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl Debug for PgTypeInfo
impl Debug for PgTypeInfo
Sourceยงimpl Deref for PgTypeInfo
impl Deref for PgTypeInfo
Sourceยงimpl Display for PgTypeInfo
impl Display for PgTypeInfo
Sourceยงimpl From<PgTypeInfo> for AnyTypeInfo
impl From<PgTypeInfo> for AnyTypeInfo
Sourceยงfn from(ty: PgTypeInfo) -> AnyTypeInfo
fn from(ty: PgTypeInfo) -> AnyTypeInfo
Converts to this type from the input type.
Sourceยงimpl PartialEq for PgTypeInfo
impl PartialEq for PgTypeInfo
Sourceยงimpl TypeInfo for PgTypeInfo
impl TypeInfo for PgTypeInfo
Sourceยงfn name(&self) -> &str
fn name(&self) -> &str
Returns the database system name of the type. Length specifiers should not be included.
Common type names are
VARCHAR
, TEXT
, or INT
. Type names should be uppercase. They
should be a rough approximation of how they are written in SQL in the given database.fn is_null(&self) -> bool
impl StructuralPartialEq for PgTypeInfo
Auto Trait Implementationsยง
impl Freeze for PgTypeInfo
impl RefUnwindSafe for PgTypeInfo
impl Send for PgTypeInfo
impl Sync for PgTypeInfo
impl Unpin for PgTypeInfo
impl UnwindSafe for PgTypeInfo
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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงunsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
๐ฌThis is a nightly-only experimental API. (
clone_to_uninit
)Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
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 moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
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