Skip to main content

ColumnIndex

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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<MySqlRow> for &str

Source§

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

Source§

impl ColumnIndex<MySqlRow> for usize

Source§

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

Source§

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

Source§

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

Source§

impl ColumnIndex<MySqlStatement<'_>> for usize

Source§

fn index(&self, statement: &MySqlStatement<'_>) -> 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§

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

Source§

impl ColumnIndex<SqliteRow> for usize

Source§

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

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§