Skip to main content

FromValues

Trait FromValues 

Source
pub trait FromValues: Sized {
    // Required method
    fn from_values(row: &Row) -> Result<Self, QueryError>;
}
Expand description

A type decoded from the columns of a row by position: a single DbType for one column, or a tuple of up to six.

ⓘ
let rows: Vec<(String, i64)> = Book::objects(&db)
    .values_list([Book::title.select(), Book::likes.select()])
    .await?;

Required Methods§

Source

fn from_values(row: &Row) -> Result<Self, QueryError>

Decode row.

§Errors

QueryError::Decode if a column is missing or has the wrong type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A: DbType, B: DbType, C: DbType, D: DbType, E: DbType, F: DbType> FromValues for (A, B, C, D, E, F)

Source§

impl<A: DbType, B: DbType, C: DbType, D: DbType, E: DbType> FromValues for (A, B, C, D, E)

Source§

impl<A: DbType, B: DbType, C: DbType, D: DbType> FromValues for (A, B, C, D)

Source§

impl<A: DbType, B: DbType, C: DbType> FromValues for (A, B, C)

Source§

impl<A: DbType, B: DbType> FromValues for (A, B)

Source§

impl<A: DbType> FromValues for (A,)

Implementors§

Source§

impl<T: DbType> FromValues for T