pub struct PgDataRow<'a> { /* private fields */ }Expand description
A temporary view of a single PostgreSQL DataRow message.
Reads columns directly from the wire buffer – no arena copy.
Column offsets are pre-computed on construction using a SmallVec
that is stack-allocated for up to 16 columns (zero heap allocation
for the common case).
Lifetime 'a borrows from Connection::read_buf.
Implementations§
Source§impl<'a> PgDataRow<'a>
impl<'a> PgDataRow<'a>
Sourcepub fn new(data: &'a [u8]) -> Result<PgDataRow<'a>, DriverError>
pub fn new(data: &'a [u8]) -> Result<PgDataRow<'a>, DriverError>
Parse column boundaries from a raw DataRow payload.
data is the DataRow message payload (after the ‘D’ type byte and
4-byte length prefix have been stripped by the framing layer).
Sourcepub fn get_raw(&self, idx: usize) -> Option<&'a [u8]>
pub fn get_raw(&self, idx: usize) -> Option<&'a [u8]>
Get the raw bytes for a column, or None if NULL.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Number of columns.
Sourcepub fn get_bool(&self, idx: usize) -> Option<bool>
pub fn get_bool(&self, idx: usize) -> Option<bool>
Get a boolean column value. Returns None on NULL or decode error.
Auto Trait Implementations§
impl<'a> Freeze for PgDataRow<'a>
impl<'a> RefUnwindSafe for PgDataRow<'a>
impl<'a> Send for PgDataRow<'a>
impl<'a> Sync for PgDataRow<'a>
impl<'a> Unpin for PgDataRow<'a>
impl<'a> UnsafeUnpin for PgDataRow<'a>
impl<'a> UnwindSafe for PgDataRow<'a>
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