pub trait RowAccess<'row> {
// Required methods
fn get_by_pos(&'row self, idx: usize) -> Option<&'row Value>;
fn get(&'row self, name: &str) -> Option<&'row Value>;
fn column_name(&'row self, idx: usize) -> Option<&'row str>;
fn len(&self) -> usize;
// Provided method
fn is_empty(&self) -> bool { ... }
}Expand description
Trait for abstracting row data access with lifetime support.
This trait allows both borrowed and owned row implementations, enabling database-specific optimizations while maintaining a common interface.
Required Methods§
Sourcefn get_by_pos(&'row self, idx: usize) -> Option<&'row Value>
fn get_by_pos(&'row self, idx: usize) -> Option<&'row Value>
Get a value by column position (0-indexed).
Returns None if the position is out of bounds.
Sourcefn get(&'row self, name: &str) -> Option<&'row Value>
fn get(&'row self, name: &str) -> Option<&'row Value>
Get a value by column name.
Returns None if the column doesn’t exist.
Sourcefn column_name(&'row self, idx: usize) -> Option<&'row str>
fn column_name(&'row self, idx: usize) -> Option<&'row str>
Get the column name at the given position.
Returns None if the position is out of bounds.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".