Skip to main content

TypeInfo

Trait TypeInfo 

Source
pub trait TypeInfo {
    const SQL_TYPE: SqlType;
    const NULLABLE: bool = false;
}
Expand description

Trait for types that have a corresponding SQL type.

Required Associated Constants§

Source

const SQL_TYPE: SqlType

The SQL type for this Rust type.

Provided Associated Constants§

Source

const NULLABLE: bool = false

Whether this type is nullable by default.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TypeInfo for bool

Source§

const SQL_TYPE: SqlType = SqlType::Boolean

Source§

impl TypeInfo for f32

Source§

const SQL_TYPE: SqlType = SqlType::Real

Source§

impl TypeInfo for f64

Source§

const SQL_TYPE: SqlType = SqlType::Double

Source§

impl TypeInfo for i8

Source§

const SQL_TYPE: SqlType = SqlType::TinyInt

Source§

impl TypeInfo for i16

Source§

const SQL_TYPE: SqlType = SqlType::SmallInt

Source§

impl TypeInfo for i32

Source§

const SQL_TYPE: SqlType = SqlType::Integer

Source§

impl TypeInfo for i64

Source§

const SQL_TYPE: SqlType = SqlType::BigInt

Source§

impl TypeInfo for String

Source§

const SQL_TYPE: SqlType = SqlType::Text

Source§

impl TypeInfo for Vec<u8>

Source§

const SQL_TYPE: SqlType = SqlType::Blob

Source§

impl<T> TypeInfo for Option<T>
where T: TypeInfo,

Source§

const SQL_TYPE: SqlType = T::SQL_TYPE

Source§

const NULLABLE: bool = true

Implementors§