pub trait RowExt {
// Required methods
fn to_object(&self) -> Value;
fn to_entries(&self) -> Vec<(String, Value)>;
}Expand description
Converts a database row into JSON.
Required Methods§
Sourcefn to_object(&self) -> Value
fn to_object(&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.
Sourcefn to_entries(&self) -> Vec<(String, Value)>
fn to_entries(&self) -> Vec<(String, Value)>
Converts this row’s columns to ordered (name, value) entries.
Keeps column order and duplicate names; values match Self::to_object.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".