Skip to main content

Mutator

Trait Mutator 

Source
pub trait Mutator: Send + Sync {
    // Required methods
    fn field(&self) -> &str;
    fn write(&self, value: Value) -> Value;
}
Expand description

自定义字段设置器(Mutator / Setter)

在写入数据库前调用,将输入值转换为存储值。

Required Methods§

Source

fn field(&self) -> &str

字段名

Source

fn write(&self, value: Value) -> Value

写入转换:将输入值转换为存储值

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§