Skip to main content

Table

Trait Table 

Source
pub trait Table {
    type Row;

    const NAME: &'static str;
    const COLUMNS: &'static [&'static str];
    const PRIMARY_KEY: Option<&'static str>;
}
Expand description

Trait for table metadata.

Implemented by types generated from #[derive(Table)] to provide table-level information.

Required Associated Constants§

Source

const NAME: &'static str

The SQL table name.

Source

const COLUMNS: &'static [&'static str]

List of all column names.

Source

const PRIMARY_KEY: Option<&'static str>

The primary key column name, if any.

Required Associated Types§

Source

type Row

The row type (the original struct).

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§