Trait FromRow

Source
pub trait FromRow {
    // Required method
    fn from_row(row: &Row) -> Result<Self, Error>
       where Self: Sized;
}
Expand description

Trait for converting database rows to Rust structs. This trait is implemented by the derive macro FromRow.

Required Methods§

Source

fn from_row(row: &Row) -> Result<Self, Error>
where Self: Sized,

Converts a database row to a Rust struct.

§Arguments
  • row - A reference to a database row
§Returns
  • Result<Self, Error> - The converted struct or an error

Implementors§