Skip to main content

RowIndex

Trait RowIndex 

Source
pub trait RowIndex<I> {
    // Required method
    fn idx(&self, idx: I) -> Option<usize>;
}
Expand description

Representing a way to index into database rows

  • Crates using existing backends should use existing implementations of this traits. Diesel provides RowIndex<usize> and RowIndex<&str> for all built-in backends

  • Crates implementing custom backends need to provide RowIndex<usize> and RowIndex<&str> impls for their Row type.

Required Methods§

Source

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

Get the numeric index inside the current row for the provided index value

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<'a, R> RowIndex<&'a str> for PartialRow<'_, R>
where R: RowIndex<&'a str>,

Source§

impl<R> RowIndex<usize> for PartialRow<'_, R>
where R: RowIndex<usize>,