pub struct Code {
pub require: bool,
pub field: String,
pub mode: String,
pub title: String,
pub def: String,
pub length: usize,
pub show: bool,
pub describe: String,
pub dec: String,
pub example: JsonValue,
}Expand description
编号
- field 字段名
- mode 模式 pass
- title 字段描述
- length 字段总长度(含小数位)
- default 默认值
- empty 是否可空
- dec 编号前缀
Fields§
§require: bool§field: String§mode: String§title: String§def: String§length: usize§show: bool§describe: String§dec: String编号前缀
example: JsonValueImplementations§
Source§impl Code
impl Code
pub fn new( require: bool, field: &str, title: &str, length: usize, dec: &str, default: &str, ) -> Self
Sourcepub fn order_code(prefix: &str, machine_id: u16) -> String
pub fn order_code(prefix: &str, machine_id: u16) -> String
生成全球唯一的X+20位订单号
Sourcepub fn code_no_13(prefix: &str) -> String
pub fn code_no_13(prefix: &str) -> String
生成X+13位编号
Sourcepub fn random_number_f64(begin: f64, finish: f64) -> f64
pub fn random_number_f64(begin: f64, finish: f64) -> f64
随机生成数字
Sourcepub fn verification_code(len: usize) -> String
pub fn verification_code(len: usize) -> String
生成验证码
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more