Skip to main content

TypeMap

Struct TypeMap 

Source
pub struct TypeMap { /* private fields */ }

Implementations§

Source§

impl TypeMap

Source

pub fn new(overrides: &[TypeOverride], copy_cheap_types: &[String]) -> Self

Source

pub fn register(&mut self, pg_name: &str, rust_name: &str, copy_cheap: bool)

Register a custom type (enum or composite) discovered from the catalog. Registered types are checked after both type_overrides and defaults, so user-level overrides and built-in defaults always take precedence.

Source

pub fn resolve_pg_type( &self, pg_type: &str, nullable: bool, is_array: bool, ) -> Option<ResolvedType>

Source

pub fn resolve_pg_type_dims( &self, pg_type: &str, nullable: bool, array_dims: usize, ) -> Option<ResolvedType>

Source

pub fn resolve_column( &self, pg_type: &str, nullable: bool, is_array: bool, column_key: Option<&str>, column_overrides: &HashMap<String, ColumnOverride>, ) -> Option<ResolvedType>

Source

pub fn resolve_column_dims( &self, pg_type: &str, nullable: bool, array_dims: usize, column_key: Option<&str>, column_overrides: &HashMap<String, ColumnOverride>, ) -> Option<ResolvedType>

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.