Struct pg_async::PgResult

source ·
pub struct PgResult {
    pub res: *mut PGresult,
    pub rows: u32,
    pub columns: u32,
}

Fields

res: *mut PGresultrows: u32columns: u32

Implementations

True if there are no rows in the result.

Number of rows.

PostgreSQL internal OID number of the column type.

Returns the column name associated with the given column number. Column numbers start at 0.

Iterator over result rows.

Converts a PostgreSQL query result into a JSON array of rows, [{$name: $value, …}, …].

Auto-unpack results.

#[derive(Deserialize)] struct Bar {id: i64}
impl Bar {
  fn load() -> Box<Future<Item=Vec<Bar>, Error=PgFutureErr>> {
    Box::new (PGA.execute ("SELECT id FROM bars") .and_then (|pr| pr[0].deserialize()))
  }
}

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.