[][src]Trait sqlx_core::column::ColumnIndex

pub trait ColumnIndex<T: ?Sized>: Sealed + Debug {
    fn index(&self, container: &T) -> Result<usize, Error>;
}

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

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, container: &T) -> Result<usize, Error>

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

Loading content...

Implementations on Foreign Types

impl<T: ?Sized, I: ColumnIndex<T> + ?Sized, '_> ColumnIndex<T> for &'_ I[src]

Loading content...

Implementors

Loading content...