ColIdx

Trait ColIdx 

Source
pub trait ColIdx: Debug + Copy {
    type SqlxMySqlIndex: ColumnIndex<MySqlRow>;
    type SqlxPostgresIndex: ColumnIndex<PgRow>;
    type SqlxSqliteIndex: ColumnIndex<SqliteRow>;

    // Required methods
    fn as_sqlx_mysql_index(&self) -> Self::SqlxMySqlIndex;
    fn as_sqlx_postgres_index(&self) -> Self::SqlxPostgresIndex;
    fn as_sqlx_sqlite_index(&self) -> Self::SqlxSqliteIndex;
    fn as_str(&self) -> Option<&str>;
    fn as_usize(&self) -> Option<&usize>;
}
Expand description

Column Index, used by TryGetable. Implemented for &str and usize

Required Associated Typesยง

Source

type SqlxMySqlIndex: ColumnIndex<MySqlRow>

Available on crate feature sqlx-mysql only.

Type surrogate

Source

type SqlxPostgresIndex: ColumnIndex<PgRow>

Available on crate feature sqlx-postgres only.

Type surrogate

Source

type SqlxSqliteIndex: ColumnIndex<SqliteRow>

Available on crate feature sqlx-sqlite only.

Type surrogate

Required Methodsยง

Source

fn as_sqlx_mysql_index(&self) -> Self::SqlxMySqlIndex

Available on crate feature sqlx-mysql only.

Basically a no-op; only to satisfy trait bounds

Source

fn as_sqlx_postgres_index(&self) -> Self::SqlxPostgresIndex

Available on crate feature sqlx-postgres only.

Basically a no-op; only to satisfy trait bounds

Source

fn as_sqlx_sqlite_index(&self) -> Self::SqlxSqliteIndex

Available on crate feature sqlx-sqlite only.

Basically a no-op; only to satisfy trait bounds

Source

fn as_str(&self) -> Option<&str>

Self must be &str, return None otherwise

Source

fn as_usize(&self) -> Option<&usize>

Self must be usize, return None otherwise

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Typesยง

Sourceยง

impl ColIdx for &str

Sourceยง

type SqlxMySqlIndex = &str

Available on crate feature sqlx-mysql only.
Sourceยง

type SqlxPostgresIndex = &str

Available on crate feature sqlx-postgres only.
Sourceยง

type SqlxSqliteIndex = &str

Available on crate feature sqlx-sqlite only.
Sourceยง

fn as_sqlx_mysql_index(&self) -> Self::SqlxMySqlIndex

Available on crate feature sqlx-mysql only.
Sourceยง

fn as_sqlx_postgres_index(&self) -> Self::SqlxPostgresIndex

Available on crate feature sqlx-postgres only.
Sourceยง

fn as_sqlx_sqlite_index(&self) -> Self::SqlxSqliteIndex

Available on crate feature sqlx-sqlite only.
Sourceยง

fn as_str(&self) -> Option<&str>

Sourceยง

fn as_usize(&self) -> Option<&usize>

Sourceยง

impl ColIdx for usize

Sourceยง

type SqlxMySqlIndex = usize

Available on crate feature sqlx-mysql only.
Sourceยง

type SqlxPostgresIndex = usize

Available on crate feature sqlx-postgres only.
Sourceยง

type SqlxSqliteIndex = usize

Available on crate feature sqlx-sqlite only.
Sourceยง

fn as_sqlx_mysql_index(&self) -> Self::SqlxMySqlIndex

Available on crate feature sqlx-mysql only.
Sourceยง

fn as_sqlx_postgres_index(&self) -> Self::SqlxPostgresIndex

Available on crate feature sqlx-postgres only.
Sourceยง

fn as_sqlx_sqlite_index(&self) -> Self::SqlxSqliteIndex

Available on crate feature sqlx-sqlite only.
Sourceยง

fn as_str(&self) -> Option<&str>

Sourceยง

fn as_usize(&self) -> Option<&usize>

Implementorsยง