Trait diesel::row::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.

Object Safety§

This trait is not object safe.

Implementors§

source§

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