Module

Trait Module 

Source
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(&self) -> &'static str { ... } fn table_unique(&self) -> &'static [&'static str] { ... } fn table_index(&self) -> &'static [&'static [&'static str]] { ... } fn table_partition(&self) -> bool { ... } fn table_partition_columns(&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§

Source

fn title(&self) -> &'static str

模型标题

Source

fn action(&mut self, name: &str) -> Result<Box<dyn Action>, String>

=================功能配置============================= 加载功能

  • name 功能名称

Provided Methods§

Source

fn _name(&self) -> &'static str

=================基础配置============================= 插件名称

Source

fn description(&self) -> &'static str

模型描述

Source

fn icon(&self) -> &'static str

=================视图配置============================= 模型icon

Source

fn table(&self) -> bool

=================数据库配置============================= 是否数据表

Source

fn _table_name(&self) -> &'static str

数据库表名称

Source

fn table_key(&self) -> &'static str

主键

Source

fn table_unique(&self) -> &'static [&'static str]

唯一索引

Source

fn table_index(&self) -> &'static [&'static [&'static str]]

查询索引

Source

fn table_partition(&self) -> bool

是否分区

Source

fn table_partition_columns(&self) -> JsonValue

分区配置 *列名 *分区key *实例 array![str, array![range1, range2, range3…]] *如果在已有分区的情况下想要修改分区的参照列,先要将当前分区代码删除后刷库,然后写新的分区规则再刷库

Source

fn fields(&mut self) -> JsonValue

模型字段

Source

fn tools(&mut self) -> Tools

使用工具

Source

fn set_global_data(&mut self, key: &str, value: JsonValue)

设置全局变量

Source

fn get_global_data(&mut self) -> JsonValue

获取全局变量数据

Source

fn get_global_data_key(&mut self, key: &str) -> JsonValue

获取全局变量指定字段数据

Implementors§