Skip to main content

RowExt

Trait RowExt 

Source
pub trait RowExt {
    // Required method
    fn to_json(&self) -> Value;
}
Expand description

Converts a single database row into a JSON object.

Required Methods§

Source

fn to_json(&self) -> Value

Converts this row’s columns to a JSON object.

Each column becomes a key in the returned object, with values converted to the most appropriate JSON type. NULL columns produce Value::Null.

§Returns

A Value::Object where keys are column names and values are type-appropriate JSON values.

Implementations on Foreign Types§

Source§

impl RowExt for MySqlRow

Source§

fn to_json(&self) -> Value

Source§

impl RowExt for PgRow

Source§

fn to_json(&self) -> Value

Source§

impl RowExt for SqliteRow

Source§

fn to_json(&self) -> Value

Implementors§