Skip to main content

QueryIdx

Trait QueryIdx 

Source
pub trait QueryIdx
where Self: Display,
{ // Required method fn idx(&self, row: &Row) -> Option<usize>; }
Expand description

A type that can address a column within a Row, either by its zero-based position (usize) or by name (&str).

Implement this for a custom column identifier (for example a generated column-name enum) to index rows with it via Row::get/Row::try_get.

Required Methods§

Source

fn idx(&self, row: &Row) -> Option<usize>

Resolves this index to the column’s zero-based position in row, or None if it does not name/point to a column in the row.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl QueryIdx for &str

Source§

fn idx(&self, row: &Row) -> Option<usize>

Source§

impl QueryIdx for usize

Source§

fn idx(&self, row: &Row) -> Option<usize>

Implementors§