Skip to main content

FromSqlBase

Trait FromSqlBase 

Source
pub trait FromSqlBase<'a>: Sized {
    // Required method
    fn accepts_postgres_type(oid: i32) -> bool;

    // Provided methods
    fn accepts(field: &FieldDescription) -> bool { ... }
    fn accepts_with_registry(
        field: &FieldDescription,
        _registry: &EnumTypeRegistry,
    ) -> bool { ... }
    fn from_null(field: &FieldDescription) -> Result<Self, ElefantClientError> { ... }
}
Expand description

Base trait providing shared functionality for both binary and text format trait implementations

Required Methods§

Provided Methods§

Source

fn accepts(field: &FieldDescription) -> bool

Source

fn accepts_with_registry( field: &FieldDescription, _registry: &EnumTypeRegistry, ) -> bool

Extended accepts check with access to the enum type registry. Override for enum types and collections of enums. Default delegates to the static accepts check.

Source

fn from_null(field: &FieldDescription) -> Result<Self, ElefantClientError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a, T> FromSqlBase<'a> for Option<T>
where T: FromSqlBase<'a>,

Source§

impl<'a, T> FromSqlBase<'a> for Vec<T>
where T: FromSqlBase<'a>,

Source§

impl<'a> FromSqlBase<'a> for &'a [u8]

Source§

impl<'a> FromSqlBase<'a> for &'a str

Source§

impl<'a> FromSqlBase<'a> for String

Source§

impl<'a> FromSqlBase<'a> for Vec<u8>

Source§

impl<'a> FromSqlBase<'a> for bool

Source§

impl<'a> FromSqlBase<'a> for char

Source§

impl<'a> FromSqlBase<'a> for f32

Source§

impl<'a> FromSqlBase<'a> for f64

Source§

impl<'a> FromSqlBase<'a> for i16

Source§

impl<'a> FromSqlBase<'a> for i32

Source§

impl<'a> FromSqlBase<'a> for i64

Implementors§

Source§

impl<'a> FromSqlBase<'a> for Inet

Source§

impl<'a> FromSqlBase<'a> for Lsn

Source§

impl<'a> FromSqlBase<'a> for Oid

Source§

impl<'a> FromSqlBase<'a> for Point