sqlx

Trait TypeInfo

Source
pub trait TypeInfo:
    Debug
    + Display
    + Clone
    + PartialEq
    + Send
    + Sync {
    // Required methods
    fn is_null(&self) -> bool;
    fn name(&self) -> &str;

    // Provided method
    fn type_compatible(&self, other: &Self) -> bool
       where Self: Sized { ... }
}
Expand description

Provides information about a SQL type for the database driver.

Required Methods§

Source

fn is_null(&self) -> bool

Source

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.

Provided Methods§

Source

fn type_compatible(&self, other: &Self) -> bool
where Self: Sized,

Return true if self and other represent mutually compatible types.

Defaults to self == other.

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.

Implementors§