Model

Trait Model 

Source
pub trait Model: Sized {
    const TABLE: &'static str;
    const PK: &'static str;
    const SOFT_DELETE_FIELD: Option<&'static str> = None;
}
Expand description

Model trait 定义了模型的基本元数据

Required Associated Constants§

Source

const TABLE: &'static str

表名

Source

const PK: &'static str

主键字段名

Provided Associated Constants§

Source

const SOFT_DELETE_FIELD: Option<&'static str> = None

逻辑删除字段名(可选),如果为 Some,则使用逻辑删除

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§