pub trait RowRef {
Show 15 methods
// Required methods
fn get_i32(&self, column: &str) -> Result<i32, RowError>;
fn get_i32_opt(&self, column: &str) -> Result<Option<i32>, RowError>;
fn get_i64(&self, column: &str) -> Result<i64, RowError>;
fn get_i64_opt(&self, column: &str) -> Result<Option<i64>, RowError>;
fn get_f64(&self, column: &str) -> Result<f64, RowError>;
fn get_f64_opt(&self, column: &str) -> Result<Option<f64>, RowError>;
fn get_bool(&self, column: &str) -> Result<bool, RowError>;
fn get_bool_opt(&self, column: &str) -> Result<Option<bool>, RowError>;
fn get_str(&self, column: &str) -> Result<&str, RowError>;
fn get_str_opt(&self, column: &str) -> Result<Option<&str>, RowError>;
fn get_bytes(&self, column: &str) -> Result<&[u8], RowError>;
fn get_bytes_opt(&self, column: &str) -> Result<Option<&[u8]>, RowError>;
// Provided methods
fn get_string(&self, column: &str) -> Result<String, RowError> { ... }
fn get_string_opt(&self, column: &str) -> Result<Option<String>, RowError> { ... }
fn get_cow_str(&self, column: &str) -> Result<Cow<'_, str>, RowError> { ... }
}Expand description
A database row that supports zero-copy access.
This trait is implemented by database-specific row types to enable efficient data extraction without unnecessary copying.
Required Methods§
Sourcefn get_i32_opt(&self, column: &str) -> Result<Option<i32>, RowError>
fn get_i32_opt(&self, column: &str) -> Result<Option<i32>, RowError>
Get an optional integer column value.
Sourcefn get_i64_opt(&self, column: &str) -> Result<Option<i64>, RowError>
fn get_i64_opt(&self, column: &str) -> Result<Option<i64>, RowError>
Get an optional 64-bit integer column value.
Sourcefn get_f64_opt(&self, column: &str) -> Result<Option<f64>, RowError>
fn get_f64_opt(&self, column: &str) -> Result<Option<f64>, RowError>
Get an optional float column value.
Sourcefn get_bool_opt(&self, column: &str) -> Result<Option<bool>, RowError>
fn get_bool_opt(&self, column: &str) -> Result<Option<bool>, RowError>
Get an optional boolean column value.
Sourcefn get_str(&self, column: &str) -> Result<&str, RowError>
fn get_str(&self, column: &str) -> Result<&str, RowError>
Get a string column value as a borrowed reference (zero-copy).
This is the key method for zero-copy deserialization. The returned string slice borrows directly from the row’s internal buffer.
Sourcefn get_str_opt(&self, column: &str) -> Result<Option<&str>, RowError>
fn get_str_opt(&self, column: &str) -> Result<Option<&str>, RowError>
Get an optional string column value as a borrowed reference.
Provided Methods§
Sourcefn get_string(&self, column: &str) -> Result<String, RowError>
fn get_string(&self, column: &str) -> Result<String, RowError>
Get a string column value as owned (for cases where ownership is needed).