pub struct Row { /* private fields */ }Expand description
A row of data returned from the database by a query.
Implementations§
Source§impl Row
impl Row
Sourcepub fn get<'a, I, T>(&'a self, idx: I) -> T
pub fn get<'a, I, T>(&'a self, idx: I) -> T
Deserializes a value from the row.
The value can be specified either by its numeric index in the row, or by its column name.
§Panics
Panics if the index is out of bounds or if the value cannot be converted to the specified type.
Sourcepub fn try_get<'a, I, T>(&'a self, idx: I) -> Result<T, Error>
pub fn try_get<'a, I, T>(&'a self, idx: I) -> Result<T, Error>
Like Row::get, but returns a Result rather than panicking.
Sourcepub fn col_buffer(&self, idx: usize) -> Option<&[u8]>
pub fn col_buffer(&self, idx: usize) -> Option<&[u8]>
Returns the raw bytes for the column at the given index.
Returns None if the value is SQL NULL.
With ResultFormat::Text, the bytes are the UTF-8 text representation
of the value — the same format PostgreSQL sends to text-mode clients.
With ResultFormat::Binary, the bytes are binary-encoded.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Row
impl !RefUnwindSafe for Row
impl !UnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnsafeUnpin for Row
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more