Skip to main content

Row

Struct Row 

Source
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>

Source

pub fn get_raw(&self, idx: usize) -> Option<&'a [u8]>

Get the raw bytes for a column, or None if NULL.

Source

pub fn is_null(&self, idx: usize) -> bool

Whether a column is NULL.

Source

pub fn column_count(&self) -> usize

Number of columns.

Source

pub fn get_bool(&self, idx: usize) -> Option<bool>

Get a boolean column value. Returns None on NULL or decode error.

Source

pub fn get_i16(&self, idx: usize) -> Option<i16>

Get an i16 column value. Returns None on NULL or decode error.

Source

pub fn get_i32(&self, idx: usize) -> Option<i32>

Get an i32 column value. Returns None on NULL or decode error.

Source

pub fn get_i64(&self, idx: usize) -> Option<i64>

Get an i64 column value. Returns None on NULL or decode error.

Source

pub fn get_f32(&self, idx: usize) -> Option<f32>

Get an f32 column value. Returns None on NULL or decode error.

Source

pub fn get_f64(&self, idx: usize) -> Option<f64>

Get an f64 column value. Returns None on NULL or decode error.

Source

pub fn get_str(&self, idx: usize) -> Option<&'a str>

Get a string column value. Returns None on NULL or decode error.

Source

pub fn get_bytes(&self, idx: usize) -> Option<&'a [u8]>

Get a byte slice column value.

Source

pub fn column_name(&self, idx: usize) -> &str

Get the column name by index.

Source

pub fn column_type_oid(&self, idx: usize) -> u32

Get the column type OID by index.

Auto Trait Implementations§

§

impl<'a> Freeze for Row<'a>

§

impl<'a> RefUnwindSafe for Row<'a>

§

impl<'a> Send for Row<'a>

§

impl<'a> Sync for Row<'a>

§

impl<'a> Unpin for Row<'a>

§

impl<'a> UnsafeUnpin for Row<'a>

§

impl<'a> UnwindSafe for Row<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.