pub trait FromRow<'a>: Sized {
// Required methods
fn from_row_text(
cols: &[FieldDescription<'_>],
row: DataRow<'a>,
) -> Result<Self>;
fn from_row_binary(
cols: &[FieldDescription<'_>],
row: DataRow<'a>,
) -> Result<Self>;
}Expand description
Trait for decoding a PostgreSQL row into a Rust type.
Required Methods§
Sourcefn from_row_text(
cols: &[FieldDescription<'_>],
row: DataRow<'a>,
) -> Result<Self>
fn from_row_text( cols: &[FieldDescription<'_>], row: DataRow<'a>, ) -> Result<Self>
Decode a row from text format (simple protocol).
Sourcefn from_row_binary(
cols: &[FieldDescription<'_>],
row: DataRow<'a>,
) -> Result<Self>
fn from_row_binary( cols: &[FieldDescription<'_>], row: DataRow<'a>, ) -> Result<Self>
Decode a row from binary format (extended protocol).
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.
Implementations on Foreign Types§
Source§impl FromRow<'_> for ()
Implementation for empty tuple - used for statements that don’t return rows
impl FromRow<'_> for ()
Implementation for empty tuple - used for statements that don’t return rows