pub struct Row<'a> { /* private fields */ }Expand description
A view into a single result row, borrowing data from the arena.
Column values are accessed by index. NULL values return None.
Decode errors (protocol violations from a malicious server) are treated
as None rather than panicking – a compliant PostgreSQL server always
sends correctly-sized data for the declared type.
Implementations§
Source§impl<'a> Row<'a>
impl<'a> Row<'a>
Sourcepub fn get_raw(&self, idx: usize) -> Option<&'a [u8]>
pub fn get_raw(&self, idx: usize) -> Option<&'a [u8]>
Get the raw bytes for a column, or None if NULL.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Number of columns.
Sourcepub fn get_bool(&self, idx: usize) -> Option<bool>
pub fn get_bool(&self, idx: usize) -> Option<bool>
Get a boolean column value. Returns None on NULL or decode error.
Sourcepub fn get_i16(&self, idx: usize) -> Option<i16>
pub fn get_i16(&self, idx: usize) -> Option<i16>
Get an i16 column value. Returns None on NULL or decode error.
Sourcepub fn get_i32(&self, idx: usize) -> Option<i32>
pub fn get_i32(&self, idx: usize) -> Option<i32>
Get an i32 column value. Returns None on NULL or decode error.
Sourcepub fn get_i64(&self, idx: usize) -> Option<i64>
pub fn get_i64(&self, idx: usize) -> Option<i64>
Get an i64 column value. Returns None on NULL or decode error.
Sourcepub fn get_f32(&self, idx: usize) -> Option<f32>
pub fn get_f32(&self, idx: usize) -> Option<f32>
Get an f32 column value. Returns None on NULL or decode error.
Sourcepub fn get_f64(&self, idx: usize) -> Option<f64>
pub fn get_f64(&self, idx: usize) -> Option<f64>
Get an f64 column value. Returns None on NULL or decode error.
Sourcepub fn get_str(&self, idx: usize) -> Option<&'a str>
pub fn get_str(&self, idx: usize) -> Option<&'a str>
Get a string column value. Returns None on NULL or decode error.
Sourcepub fn column_name(&self, idx: usize) -> &str
pub fn column_name(&self, idx: usize) -> &str
Get the column name by index.
Sourcepub fn column_type_oid(&self, idx: usize) -> u32
pub fn column_type_oid(&self, idx: usize) -> u32
Get the column type OID by index.