Trait ColumnIndex

Source
pub trait ColumnIndex<T>: Debug
where T: ?Sized,
{ // Required method fn index(&self, container: &T) -> Result<usize, Error>; }
Expand description

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.

Required Methodsยง

Source

fn index(&self, container: &T) -> Result<usize, Error>

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

Implementations on Foreign Typesยง

Sourceยง

impl ColumnIndex<AnyRow> for usize

Sourceยง

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

Sourceยง

impl ColumnIndex<AnyStatement<'_>> for usize

Sourceยง

fn index(&self, statement: &AnyStatement<'_>) -> Result<usize, Error>

Sourceยง

impl ColumnIndex<PgRow> for &str

Sourceยง

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

Sourceยง

impl ColumnIndex<PgRow> for usize

Sourceยง

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

Sourceยง

impl ColumnIndex<PgStatement<'_>> for &str

Sourceยง

fn index(&self, statement: &PgStatement<'_>) -> Result<usize, Error>

Sourceยง

impl ColumnIndex<PgStatement<'_>> for usize

Sourceยง

fn index(&self, statement: &PgStatement<'_>) -> Result<usize, Error>

Sourceยง

impl ColumnIndex<SqliteRow> for &str

Sourceยง

impl ColumnIndex<SqliteRow> for usize

Sourceยง

impl ColumnIndex<SqliteStatement<'_>> for &str

Sourceยง

fn index(&self, statement: &SqliteStatement<'_>) -> Result<usize, Error>

Sourceยง

impl ColumnIndex<SqliteStatement<'_>> for usize

Sourceยง

fn index(&self, statement: &SqliteStatement<'_>) -> Result<usize, Error>

Sourceยง

impl<'i> ColumnIndex<AnyRow> for &'i str

Sourceยง

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

Sourceยง

impl<'i> ColumnIndex<AnyStatement<'_>> for &'i str

Sourceยง

fn index(&self, statement: &AnyStatement<'_>) -> Result<usize, Error>

Sourceยง

impl<T, I> ColumnIndex<T> for &I
where I: ColumnIndex<T> + ?Sized, T: ?Sized,

Sourceยง

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

Implementorsยง