pub trait Row<'a, DB: Backend>: RowIndex<usize> + for<'b> RowIndex<&'b str> + RowSealed + Sized {
type Field<'f>: Field<'f, DB>
where Self: 'f,
'a: 'f;
// Required methods
fn field_count(&self) -> usize;
fn get<'b, I>(&'b self, idx: I) -> Option<Self::Field<'b>>
where Self: RowIndex<I>,
'a: 'b;
// Provided method
fn get_value<ST, T, I>(&self, idx: I) -> Result<T>
where Self: RowIndex<I>,
T: FromSql<ST, DB> { ... }
}
Expand description
Represents a single database row.
This trait is used as an argument to FromSqlRow
.
Required Associated Types§
sourcetype Field<'f>: Field<'f, DB>
where
Self: 'f,
'a: 'f
type Field<'f>: Field<'f, DB> where Self: 'f, 'a: 'f
Field type returned by a Row
implementation
-
Crates using existing backends 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
Required Methods§
sourcefn field_count(&self) -> usize
fn field_count(&self) -> usize
Get the number of fields in the current row