Trait butane::DataResult

source ·
pub trait DataResult: Sized {
    type DBO: DataObject;

    const COLUMNS: &'static [Column];

    // Required methods
    fn from_row<'a>(row: &(dyn BackendRow + 'a)) -> Result<Self, Error>
       where Self: Sized;
    fn query() -> Query<Self>;
}
Expand description

A type which may be the result of a database query.

Every result type must have a corresponding object type and the columns of the result type must be a subset of the columns of the object type. The purpose of a result type which is not also an object type is to allow a query to retrieve a subset of an object’s columns.

Required Associated Types§

source

type DBO: DataObject

Corresponding object type.

Required Associated Constants§

source

const COLUMNS: &'static [Column]

Required Methods§

source

fn from_row<'a>(row: &(dyn BackendRow + 'a)) -> Result<Self, Error>where Self: Sized,

source

fn query() -> Query<Self>

Create a blank query (matching all rows) for this type.

Implementors§