Skip to main content

ColumnIndex

Trait ColumnIndex 

Source
pub trait ColumnIndex<T>: Sealed + 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.

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

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

Sourceยง

impl ColumnIndex<MssqlRow> for usize

Sourceยง

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

Sourceยง

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

Sourceยง

impl ColumnIndex<MssqlStatement<'_>> for usize

Sourceยง

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

Sourceยง

impl ColumnIndex<MySqlRow> for &str

Sourceยง

impl ColumnIndex<MySqlRow> for usize

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

Sourceยง

impl ColumnIndex<OdbcRow> for usize

Sourceยง

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

Sourceยง

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

Sourceยง

impl ColumnIndex<OdbcStatement<'_>> for usize

Sourceยง

fn index(&self, statement: &OdbcStatement<'_>) -> 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
where &'i str: AnyColumnIndex,

Sourceยง

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

Sourceยง

impl<'i> ColumnIndex<AnyStatement<'_>> for &'i str
where &'i str: AnyColumnIndex,

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ยง