[][src]Struct c3p0_pool_pg::r2d2::postgres::rows::Row

pub struct Row<'a> { /* fields omitted */ }

A single result row of a query.

Methods

impl<'a> Row<'a>[src]

pub fn len(&self) -> usize[src]

Returns the number of values in the row.

pub fn is_empty(&self) -> bool[src]

Determines if there are any values in the row.

pub fn columns(&self) -> &[Column][src]

Returns a slice describing the columns of the Row.

pub fn get<I, T>(&self, idx: I) -> T where
    I: RowIndex + Debug,
    T: FromSql
[src]

Retrieves the contents of a field of the row.

A field can be accessed by the name or index of its column, though access by index is more efficient. Rows are 0-indexed.

Panics

Panics if the index does not reference a column or the return type is not compatible with the Postgres type.

Example

let stmt = conn.prepare("SELECT foo, bar from BAZ").unwrap();
for row in &stmt.query(&[]).unwrap() {
    let foo: i32 = row.get(0);
    let bar: String = row.get("bar");
    println!("{}: {}", foo, bar);
}

pub fn get_opt<I, T>(&self, idx: I) -> Option<Result<T, Error>> where
    I: RowIndex,
    T: FromSql
[src]

Retrieves the contents of a field of the row.

A field can be accessed by the name or index of its column, though access by index is more efficient. Rows are 0-indexed.

Returns None if the index does not reference a column, Some(Err(..)) if there was an error converting the result value, and Some(Ok(..)) on success.

pub fn get_bytes<I>(&self, idx: I) -> Option<&[u8]> where
    I: RowIndex + Debug
[src]

Retrieves the specified field as a raw buffer of Postgres data.

Panics

Panics if the index does not reference a column.

Trait Implementations

impl<'a> Debug for Row<'a>[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self