pub struct StreamRow { /* private fields */ }Expand description
A streaming row optimized for sequential single-pass access.
Unlike Row, this computes column offsets on-demand without pre-allocation.
Best for high-throughput scans where each row is processed once.
§Example
// High-throughput streaming access
let mut stream = client.query_streaming("SELECT id, value FROM sensors", 1000)?;
while let Some(chunk) = stream.next_chunk()? {
for row in chunk {
if let Some(id) = row.get_i32(0) {
process(id, row.get_f64(1));
}
}
}Implementations§
Source§impl StreamRow
impl StreamRow
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Returns the number of columns.
Sourcepub fn get_bytes(&self, idx: usize) -> Option<&[u8]>
pub fn get_bytes(&self, idx: usize) -> Option<&[u8]>
Gets raw bytes for a column, or None if NULL.
Sourcepub fn get_i16(&self, idx: usize) -> Option<i16>
pub fn get_i16(&self, idx: usize) -> Option<i16>
Gets an i16 value. Returns None if NULL or wrong size.
Sourcepub fn get_i32(&self, idx: usize) -> Option<i32>
pub fn get_i32(&self, idx: usize) -> Option<i32>
Gets an i32 value. Returns None if NULL or wrong size.
Sourcepub fn get_i64(&self, idx: usize) -> Option<i64>
pub fn get_i64(&self, idx: usize) -> Option<i64>
Gets an i64 value. Returns None if NULL or wrong size.
Sourcepub fn get_f32(&self, idx: usize) -> Option<f32>
pub fn get_f32(&self, idx: usize) -> Option<f32>
Gets an f32 value. Returns None if NULL or wrong size.
Sourcepub fn get_f64(&self, idx: usize) -> Option<f64>
pub fn get_f64(&self, idx: usize) -> Option<f64>
Gets an f64 value. Returns None if NULL or wrong size.
Sourcepub fn get_bool(&self, idx: usize) -> Option<bool>
pub fn get_bool(&self, idx: usize) -> Option<bool>
Gets a bool value. Returns None if NULL or invalid.
Sourcepub fn get_string(&self, idx: usize) -> Option<String>
pub fn get_string(&self, idx: usize) -> Option<String>
Gets a String value. Returns None if NULL or invalid UTF-8.
Sourcepub fn get<T: FromBinaryValue>(&self, idx: usize) -> Option<T>
pub fn get<T: FromBinaryValue>(&self, idx: usize) -> Option<T>
Generic typed getter with automatic type coercion.
Supports widening conversions (i16 → i32 → i64, f32 → f64).
Sourcepub fn to_batch(self) -> BatchRow
pub fn to_batch(self) -> BatchRow
Converts to a BatchRow with pre-computed offsets for multi-column access.
Sourcepub fn into_data(self) -> DataRowBody
pub fn into_data(self) -> DataRowBody
Returns the underlying DataRowBody (for advanced use).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StreamRow
impl RefUnwindSafe for StreamRow
impl Send for StreamRow
impl Sync for StreamRow
impl Unpin for StreamRow
impl UnsafeUnpin for StreamRow
impl UnwindSafe for StreamRow
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request