Skip to main content

FromRow

Trait FromRow 

Source
pub trait FromRow: Sized {
    // Required method
    fn from_row(row: &Row) -> Result<Self>;
}
Expand description

Trait for converting a libsql::Row into a Rust struct.

Implement this per struct, choosing positional (row.get(idx)) or name-based (ColumnMap) access for each column.

Required Methods§

Source

fn from_row(row: &Row) -> Result<Self>

Convert a row into Self.

§Errors

Returns an error if a column is missing or has an incompatible type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§