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§
Sourceconst PRIMARY_KEY: Self::Column
const PRIMARY_KEY: Self::Column
The primary key column.
Required Associated Types§
Provided Methods§
Sourcefn format_column(col: &Self::Column) -> String
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.