diesel::row

Trait NamedRow

Source
pub trait NamedRow<'a, DB: Backend>: Row<'a, DB> {
    // Required method
    fn get<ST, T>(&self, column_name: &str) -> Result<T>
       where T: FromSql<ST, DB>;
}
Expand description

Represents a row of a SQL query, where the values are accessed by name rather than by index.

This trait is used by implementations of QueryableByName

Required Methods§

Source

fn get<ST, T>(&self, column_name: &str) -> Result<T>
where T: FromSql<ST, DB>,

Retrieve and deserialize a single value from the query

Note that ST must be the exact type of the value with that name in the query. The compiler will not be able to verify that you have provided the correct type. If there is a mismatch, you may receive an incorrect value, or a runtime error.

If two or more fields in the query have the given name, the result of this function is undefined.

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.

Implementors§

Source§

impl<'a, R, DB> NamedRow<'a, DB> for R
where R: Row<'a, DB>, DB: Backend,