Skip to main content

SQLColumnInfo

Trait SQLColumnInfo 

Source
pub trait SQLColumnInfo: Send + Sync {
    // Required methods
    fn is_not_null(&self) -> bool;
    fn is_primary_key(&self) -> bool;
    fn is_unique(&self) -> bool;
    fn name(&self) -> &'static str;
    fn type(&self) -> &'static str;
    fn has_default(&self) -> bool;
    fn table(&self) -> &'static dyn SQLTableInfo;
}
Expand description

Runtime metadata of a column, usable as a trait object.

Generated by the table macros for each column.

Required Methods§

Source

fn is_not_null(&self) -> bool

Whether the column is NOT NULL.

Source

fn is_primary_key(&self) -> bool

Whether the column is part of the primary key.

Source

fn is_unique(&self) -> bool

Whether the column has a UNIQUE constraint.

Source

fn name(&self) -> &'static str

The column’s SQL name.

Source

fn type(&self) -> &'static str

The column’s SQL type, as written in CREATE TABLE.

Source

fn has_default(&self) -> bool

Whether the column has a default value.

Source

fn table(&self) -> &'static dyn SQLTableInfo

The table the column belongs to.

Trait Implementations§

Source§

impl Debug for dyn SQLColumnInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: SQLColumnInfo> SQLColumnInfo for &T

Source§

fn is_not_null(&self) -> bool

Source§

fn is_primary_key(&self) -> bool

Source§

fn is_unique(&self) -> bool

Source§

fn name(&self) -> &'static str

Source§

fn type(&self) -> &'static str

Source§

fn has_default(&self) -> bool

Source§

fn table(&self) -> &'static dyn SQLTableInfo

Implementors§