[−][src]Struct c3p0_pg::r2d2::postgres::rows::Row
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]
I: RowIndex + Debug,
T: FromSql,
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]
I: RowIndex,
T: FromSql,
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]
I: RowIndex + Debug,
Retrieves the specified field as a raw buffer of Postgres data.
Panics
Panics if the index does not reference a column.
Trait Implementations
Auto Trait Implementations
impl<'a> Sync for Row<'a>
impl<'a> Send for Row<'a>
impl<'a> Unpin for Row<'a>
impl<'a> RefUnwindSafe for Row<'a>
impl<'a> UnwindSafe for Row<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self