pub trait Module {
Show 17 methods
// Required methods
fn title(&self) -> &'static str;
fn action(&mut self, name: &str) -> Result<Box<dyn Action>, String>;
// Provided methods
fn _name(&self) -> &'static str { ... }
fn description(&self) -> &'static str { ... }
fn icon(&self) -> &'static str { ... }
fn table(&self) -> bool { ... }
fn _table_name(&self) -> &'static str { ... }
fn table_key(&mut self) -> &'static str { ... }
fn table_unique(&self) -> &'static [&'static str] { ... }
fn table_index(&mut self) -> &'static [&'static [&'static str]] { ... }
fn table_partition(&mut self) -> bool { ... }
fn table_partition_columns(&mut self) -> JsonValue { ... }
fn fields(&mut self) -> JsonValue { ... }
fn tools(&mut self) -> Tools { ... }
fn set_global_data(&mut self, key: &str, value: JsonValue) { ... }
fn get_global_data(&mut self) -> JsonValue { ... }
fn get_global_data_key(&mut self, key: &str) -> JsonValue { ... }
}Expand description
模型配置
Required Methods§
Provided Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
模型描述
Sourcefn _table_name(&self) -> &'static str
fn _table_name(&self) -> &'static str
数据库表名称
Sourcefn table_unique(&self) -> &'static [&'static str]
fn table_unique(&self) -> &'static [&'static str]
唯一索引
Sourcefn table_index(&mut self) -> &'static [&'static [&'static str]]
fn table_index(&mut self) -> &'static [&'static [&'static str]]
查询索引
Sourcefn table_partition(&mut self) -> bool
fn table_partition(&mut self) -> bool
是否分区
Sourcefn table_partition_columns(&mut self) -> JsonValue
fn table_partition_columns(&mut self) -> JsonValue
分区配置 *列名 *分区key *实例 array![str, array![range1, range2, range3…]] *如果在已有分区的情况下想要修改分区的参照列,先要将当前分区代码删除后刷库,然后写新的分区规则再刷库
Sourcefn set_global_data(&mut self, key: &str, value: JsonValue)
fn set_global_data(&mut self, key: &str, value: JsonValue)
设置全局变量
Sourcefn get_global_data(&mut self) -> JsonValue
fn get_global_data(&mut self) -> JsonValue
获取全局变量数据
Sourcefn get_global_data_key(&mut self, key: &str) -> JsonValue
fn get_global_data_key(&mut self, key: &str) -> JsonValue
获取全局变量指定字段数据