Skip to main content

ColumnIndex

Trait ColumnIndex 

Source
pub trait ColumnIndex:
    ColumnIndex
    + Debug
    + Display { }
Expand description

A trait for types that can be used to index into a Row.

§Example

fn print_column_value<I: ColumnIndex>(row: &Row, index: I) -> Result<(), google_cloud_spanner::Error> {
    let value: String = row.get(index)?;
    println!("Value: {value}");
    Ok(())
}

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

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

Source§

impl ColumnIndex for String

Source§

impl ColumnIndex for usize

Source§

impl<T: ?Sized + ColumnIndex> ColumnIndex for &T

Implementors§