pub trait FromRow: Sized {
// Required methods
fn from_row(row: &Row) -> Self;
fn try_from_row(row: &Row) -> Result<Self, Error>;
}
Expand description
A trait that allows mapping rows from either postgres or tokio-postgres, to other types.
Required Methods§
Sourcefn try_from_row(row: &Row) -> Result<Self, Error>
fn try_from_row(row: &Row) -> Result<Self, Error>
Try’s to perform the conversion.
Will return an error if the row does not contain the expected column names.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.