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§
sourcefn get<ST, T>(&self, column_name: &str) -> Result<T>where
T: FromSql<ST, DB>,
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.