Fields
res: *mut PGresult
rows: u32
columns: u32
Implementations
sourceimpl PgResult
impl PgResult
sourcepub fn fname<'a>(&'a self, column: u32) -> Result<&'a str, Utf8Error>
pub fn fname<'a>(&'a self, column: u32) -> Result<&'a str, Utf8Error>
Returns the column name associated with the given column number. Column numbers start at 0.
pub fn row(&self, row: u32) -> PgRow<'_>
sourcepub fn iter<'a>(&'a self) -> PgResultIt<'a>ⓘNotable traits for PgResultIt<'a>impl<'a> Iterator for PgResultIt<'a> type Item = PgRow<'a>;
pub fn iter<'a>(&'a self) -> PgResultIt<'a>ⓘNotable traits for PgResultIt<'a>impl<'a> Iterator for PgResultIt<'a> type Item = PgRow<'a>;
Iterator over result rows.
sourcepub fn to_json(&self) -> Result<Json, PgFutureErr>
pub fn to_json(&self) -> Result<Json, PgFutureErr>
Converts a PostgreSQL query result into a JSON array of rows, [{$name: $value, …}, …].
sourcepub fn deserialize<T: DeserializeOwned>(&self) -> Result<Vec<T>, PgFutureErr>
pub fn deserialize<T: DeserializeOwned>(&self) -> Result<Vec<T>, PgFutureErr>
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
impl Send for PgResult
impl Sync for PgResult
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more