zino_orm

Trait Entity

Source
pub trait Entity: Model {
    type Column: AsRef<str> + Display;

    const PRIMARY_KEY: Self::Column;

    // Provided method
    fn format_column(col: &Self::Column) -> String { ... }
}
Expand description

An interface for the model entity.

Required Associated Constants§

Source

const PRIMARY_KEY: Self::Column

The primary key column.

Required Associated Types§

Source

type Column: AsRef<str> + Display

The column type.

Provided Methods§

Source

fn format_column(col: &Self::Column) -> String

Formats the column name.

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§