[][src]Trait diesel::row::Row

pub trait Row<'a, DB: Backend>: RowIndex<usize> + for<'b> RowIndex<&'b str> + Sized {
    type Field: Field<'a, DB>;
    fn field_count(&self) -> usize;
fn get<I>(&self, idx: I) -> Option<Self::Field>
    where
        Self: RowIndex<I>
; }

Represents a single database row.

This trait is used as an argument to FromSqlRow.

Associated Types

type Field: Field<'a, DB>

Field type returned by a Row implementation

  • Crates using existing backend should not concern themself with the concrete type of this associated type.

  • Crates implementing custom backends should provide their own type meeting the required trait bounds

Loading content...

Required methods

fn field_count(&self) -> usize

Get the number of fields in the current row

fn get<I>(&self, idx: I) -> Option<Self::Field> where
    Self: RowIndex<I>, 

Get the field with the provided index from the row.

Returns None if there is no matching field for the given index

Loading content...

Implementors

Loading content...