[][src]Trait sqlx::row::ColumnIndex

pub trait ColumnIndex<'c, R>: Sealed where
    R: Row<'c> + ?Sized
{ fn index(&self, row: &R) -> Result<usize, Error>; }

A type that can be used to index into a Row.

The get and try_get methods of Row accept any type that implements ColumnIndex. This trait is implemented for strings which are used to look up a column by name, and for usize which is used as a positional index into the row.

This trait is sealed and cannot be implemented for types outside of SQLx.

Required methods

fn index(&self, row: &R) -> Result<usize, Error>

Returns a valid positional index into the row, ColumnIndexOutOfBounds, or, ColumnNotFound.

Loading content...

Implementations on Foreign Types

impl<'c> ColumnIndex<'c, MySqlRow<'c>> for usize[src]

impl<'c> ColumnIndex<'c, MySqlRow<'c>> for str[src]

impl<'c> ColumnIndex<'c, PgRow<'c>> for usize[src]

impl<'c> ColumnIndex<'c, SqliteRow<'c>> for str[src]

impl<'c, '_, R, I> ColumnIndex<'c, R> for &'_ I where
    I: ColumnIndex<'c, R> + ?Sized,
    R: Row<'c>, 
[src]

impl<'c> ColumnIndex<'c, PgRow<'c>> for str[src]

impl<'c> ColumnIndex<'c, SqliteRow<'c>> for usize[src]

Loading content...

Implementors

Loading content...