Skip to main content

BindIndex

Trait BindIndex 

Source
pub trait BindIndex: Sealed {
    // Required method
    fn idx(&self, stmt: &Statement<'_>) -> Result<usize>;
}
Expand description

A trait implemented by types that can index into parameters of a statement.

It is only implemented for usize and &str and &CStr.

Required Methods§

Source

fn idx(&self, stmt: &Statement<'_>) -> Result<usize>

Returns the index of the associated parameter, or Error if no such parameter exists.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl BindIndex for &CStr

C-string literal to avoid alloc

Source§

fn idx(&self, stmt: &Statement<'_>) -> Result<usize>

Source§

impl BindIndex for &str

Source§

fn idx(&self, stmt: &Statement<'_>) -> Result<usize>

Source§

impl BindIndex for usize

Source§

fn idx(&self, _: &Statement<'_>) -> Result<usize>

Implementors§