RowRef

Trait RowRef 

Source
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§

Source

fn get_i32(&self, column: &str) -> Result<i32, RowError>

Get an integer column value.

Source

fn get_i32_opt(&self, column: &str) -> Result<Option<i32>, RowError>

Get an optional integer column value.

Source

fn get_i64(&self, column: &str) -> Result<i64, RowError>

Get a 64-bit integer column value.

Source

fn get_i64_opt(&self, column: &str) -> Result<Option<i64>, RowError>

Get an optional 64-bit integer column value.

Source

fn get_f64(&self, column: &str) -> Result<f64, RowError>

Get a float column value.

Source

fn get_f64_opt(&self, column: &str) -> Result<Option<f64>, RowError>

Get an optional float column value.

Source

fn get_bool(&self, column: &str) -> Result<bool, RowError>

Get a boolean column value.

Source

fn get_bool_opt(&self, column: &str) -> Result<Option<bool>, RowError>

Get an optional boolean column value.

Source

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.

Source

fn get_str_opt(&self, column: &str) -> Result<Option<&str>, RowError>

Get an optional string column value as a borrowed reference.

Source

fn get_bytes(&self, column: &str) -> Result<&[u8], RowError>

Get a bytes column value as a borrowed reference (zero-copy).

Source

fn get_bytes_opt(&self, column: &str) -> Result<Option<&[u8]>, RowError>

Get optional bytes as borrowed reference.

Provided Methods§

Source

fn get_string(&self, column: &str) -> Result<String, RowError>

Get a string column value as owned (for cases where ownership is needed).

Source

fn get_string_opt(&self, column: &str) -> Result<Option<String>, RowError>

Get an optional string as owned.

Source

fn get_cow_str(&self, column: &str) -> Result<Cow<'_, str>, RowError>

Get column value as a Cow, borrowing when possible.

Implementors§