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

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

A single result row of a query.

Methods

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

Returns the number of values in the row.

Determines if there are any values in the row.

Returns a slice describing the columns of the Row.

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);
}

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.

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]

Formats the value using the given formatter.