Skip to main content

Accessor

Trait Accessor 

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

自定义字段读取器(Accessor / Getter)

在从数据库读取字段值后调用,将存储值转换为展示值。

Required Methods§

Source

fn field(&self) -> &str

字段名

Source

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

读取转换:将存储值转换为展示值

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§