Type Alias xitca_postgres::row::RowSimple

source ·
pub type RowSimple<'r> = GenericRow<&'r [Column], &'r mut Vec<Range<usize>>, NoTyped>;
Expand description

A row of data returned from the database by a simple query.

Aliased Type§

struct RowSimple<'r> { /* private fields */ }

Implementations§

source§

impl RowSimple<'_>

source

pub fn get(&self, idx: impl RowIndexAndType + Display) -> Option<&str>

Returns a value from the row.

The value can be specified either by its numeric index in the row, or by its column name.

§Panics

Panics if the index is out of bounds or if the value cannot be converted to the specified type.

source

pub fn try_get( &self, idx: impl RowIndexAndType + Display, ) -> Result<Option<&str>, Error>

Like RowSimple::get, but returns a Result rather than panicking.