pub struct QueryResult { /* private fields */ }Expand description
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn from_parts(
all_col_offsets: Vec<(usize, i32)>,
num_cols: usize,
columns: Arc<[ColumnDesc]>,
affected_rows: u64,
) -> QueryResult
pub fn from_parts( all_col_offsets: Vec<(usize, i32)>, num_cols: usize, columns: Arc<[ColumnDesc]>, affected_rows: u64, ) -> QueryResult
Construct a QueryResult from its constituent parts.
Used by bsql-core’s streaming layer to assemble per-chunk results.
Sourcepub fn from_parts_with_buf(
all_col_offsets: Vec<(usize, i32)>,
num_cols: usize,
columns: Arc<[ColumnDesc]>,
affected_rows: u64,
data_buf: Vec<u8>,
) -> QueryResult
pub fn from_parts_with_buf( all_col_offsets: Vec<(usize, i32)>, num_cols: usize, columns: Arc<[ColumnDesc]>, affected_rows: u64, data_buf: Vec<u8>, ) -> QueryResult
Construct with inline data buffer (zero-copy from wire).
Sourcepub fn affected_rows(&self) -> u64
pub fn affected_rows(&self) -> u64
Number of affected rows (for INSERT/UPDATE/DELETE).
Sourcepub fn columns(&self) -> &[ColumnDesc]
pub fn columns(&self) -> &[ColumnDesc]
Column descriptors.
Sourcepub fn row<'a>(&'a self, idx: usize, arena: &'a Arena) -> Row<'a>
pub fn row<'a>(&'a self, idx: usize, arena: &'a Arena) -> Row<'a>
Get a row by index. The returned Row borrows from the arena or
the inline data buffer.
Sourcepub fn take_col_offsets(&mut self) -> Vec<(usize, i32)>
pub fn take_col_offsets(&mut self) -> Vec<(usize, i32)>
Take the col_offsets vec out of this result, leaving it empty.
Used by QueryStream to reclaim and reuse the allocation between chunks
instead of allocating a new Vec per chunk.
Sourcepub fn take_data_buf(&mut self) -> Option<Vec<u8>>
pub fn take_data_buf(&mut self) -> Option<Vec<u8>>
Take the data buffer for recycling. Returns None if no data_buf.
Auto Trait Implementations§
impl Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnsafeUnpin for QueryResult
impl UnwindSafe for QueryResult
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