Module

Trait Module 

Source
pub trait Module:
    Send
    + Sync
    + 'static {
Show 27 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 module_name(&self) -> &'static str { ... } fn description(&self) -> &'static str { ... } fn tags(&self) -> &'static [&'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 init_data(&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 { ... } fn db_table(&mut self) -> Db { ... } fn db_find(&mut self, id: &str) -> JsonValue { ... } fn db_select(&mut self, ids: &str) -> JsonValue { ... } fn db_insert(&mut self, data: JsonValue) -> String { ... } fn db_delete(&mut self, id: &str) -> usize { ... } fn db_update(&mut self, id: &str, data: JsonValue) -> usize { ... } fn handle(&mut self) { ... }
}
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 module_name(&self) -> &'static str

模型名称 xxx.xxx

Source

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

模型描述

Source

fn tags(&self) -> &'static [&'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 init_data(&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

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

Source

fn db_table(&mut self) -> Db

Source

fn db_find(&mut self, id: &str) -> JsonValue

Source

fn db_select(&mut self, ids: &str) -> JsonValue

Source

fn db_insert(&mut self, data: JsonValue) -> String

Source

fn db_delete(&mut self, id: &str) -> usize

Source

fn db_update(&mut self, id: &str, data: JsonValue) -> usize

Source

fn handle(&mut self)

监听

Implementors§