Skip to main content

FromRow

Trait FromRow 

Source
pub trait FromRow: Sized {
    // Required method
    fn from_row(row: HashMap<String, Value>) -> Result<Self, QueryError>;
}
Expand description

HashMap<String, Value> 按列名反序列化(更鲁棒)

适用于列顺序不固定或查询使用 * 的场景。 按列名查找,不受 SQL 列顺序影响。

Required Methods§

Source

fn from_row(row: HashMap<String, Value>) -> Result<Self, QueryError>

从列名到值的映射构造实例

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§