Struct sqlx_models_orm::PgTypeInfo
[−]pub struct PgTypeInfo(_);
Expand description
Type information for a PostgreSQL type.
Implementations
impl PgTypeInfo
impl PgTypeInfo
pub fn kind(&self) -> &PgTypeKind
pub fn kind(&self) -> &PgTypeKind
Returns the kind (simple, array, enum, etc.) for this type.
pub 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.
pub 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
impl Clone for PgTypeInfo
impl Clone for PgTypeInfo
fn clone(&self) -> PgTypeInfo
fn clone(&self) -> PgTypeInfo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for PgTypeInfo
impl Debug for PgTypeInfo
impl Deref for PgTypeInfo
impl Deref for PgTypeInfo
type Target = PgType
type Target = PgType
The resulting type after dereferencing.
fn deref(&self) -> &<PgTypeInfo as Deref>::Target
fn deref(&self) -> &<PgTypeInfo as Deref>::Target
Dereferences the value.
impl<'de> Deserialize<'de> for PgTypeInfo
impl<'de> Deserialize<'de> for PgTypeInfo
fn deserialize<__D>(
__deserializer: __D
) -> Result<PgTypeInfo, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<PgTypeInfo, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Display for PgTypeInfo
impl Display for PgTypeInfo
impl PartialEq<PgTypeInfo> for PgTypeInfo
impl PartialEq<PgTypeInfo> for PgTypeInfo
fn eq(&self, other: &PgTypeInfo) -> bool
fn eq(&self, other: &PgTypeInfo) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &PgTypeInfo) -> bool
fn ne(&self, other: &PgTypeInfo) -> bool
This method tests for !=
.
impl Serialize for PgTypeInfo
impl Serialize for PgTypeInfo
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl TypeInfo for PgTypeInfo
impl TypeInfo for PgTypeInfo
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. Read more
fn is_null(&self) -> bool
impl StructuralPartialEq for PgTypeInfo
Auto Trait Implementations
impl RefUnwindSafe for PgTypeInfo
impl Send for PgTypeInfo
impl Sync for PgTypeInfo
impl Unpin for PgTypeInfo
impl UnwindSafe for PgTypeInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more