pub trait FromSpgRow: Sized {
// Required method
fn from_spg_row(row: &[Value]) -> Result<Self, EngineError>;
}Expand description
v6.10.3 — trait that maps a row’s columns onto a user
struct’s fields. v7.3.0 ships the spg_row! declarative
macro that generates impl FromSpgRow for YourStruct from
a struct definition (no proc-macro, no syn/quote/
proc-macro2 deps — the workspace’s “0 external deps”
policy holds).
Implementors map a row’s columns onto a user struct’s
fields. Errors surface as EngineError::Unsupported so the
caller’s error type stays uniform.
Required Methods§
Sourcefn from_spg_row(row: &[Value]) -> Result<Self, EngineError>
fn from_spg_row(row: &[Value]) -> Result<Self, EngineError>
Decode one query result row into Self. Called once per
row by Database::query_typed. The slice length equals
the number of columns in the SELECT projection.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".