Skip to main content

Module row

Module row 

Source
Expand description

Row handling for query results.

This module provides three row types optimized for different access patterns:

  • Row - Standard row with pre-computed offsets for random access
  • StreamRow - Zero-allocation row for high-throughput sequential scans
  • BatchRow - Pre-computed offsets for multi-column batch access

§Example

for row in client.query("SELECT id, name FROM users")? {
    let id = row.get_i32(0);      // Option<i32>
    let name = row.get_string(1); // Option<String>
    println!("{:?}: {:?}", id, name);
}

§Attribution

The Row / StreamRow / BatchRow type decomposition and the pre-computed-offset random-access pattern were adapted from tokio-postgres (Copyright (c) 2016 Steven Fackler, MIT or Apache-2.0). Hyper-specific performance changes were added on top. See the NOTICE file at the repo root for the full upstream copyright and reproduced license text.

Structs§

BatchRow
A row with pre-computed offsets for fast multi-column batch access.
Row
A row of data from a query result.
StreamRow
A streaming row optimized for sequential single-pass access.

Traits§

FromBinaryValue
Trait for extracting typed values from binary row data with automatic coercion.