pub trait Module: Sized {
// Required method
fn name(&self) -> ModuleName;
// Provided methods
fn table(&self) -> Option<TableName> { ... }
fn fields(&self) -> Fields { ... }
fn configure_table(&self, table: TableSpec) -> TableSpec { ... }
fn actions(&self) -> Actions { ... }
fn views(&self) -> Vec<ViewSpec> { ... }
fn into_spec(self) -> ModuleSpec { ... }
}Expand description
业务 Module:fields/actions/views 仍集中在同一个实现中。
Required Methods§
Sourcefn name(&self) -> ModuleName
fn name(&self) -> ModuleName
返回全限定 Module 名。
Provided Methods§
Sourcefn configure_table(&self, table: TableSpec) -> TableSpec
fn configure_table(&self, table: TableSpec) -> TableSpec
在统一字段投影后补充表标题、复合索引等表级约束。
Sourcefn into_spec(self) -> ModuleSpec
fn into_spec(self) -> ModuleSpec
直接聚合为唯一 ModuleSpec,不经过兼容投影。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".