Macro impl_from_row
Source macro_rules! impl_from_row {
($type:ident { $($field:ident : i32),* $(,)? }) => { ... };
($type:ident { $($field:ident : $field_type:ty),* $(,)? }) => { ... };
}
Expand description
Macro to implement FromRow for simple structs.
This generates efficient deserialization code that minimizes allocations.
§Example
ⓘuse prax_query::impl_from_row;
struct User {
id: i32,
email: String,
name: Option<String>,
}
impl_from_row!(User {
id: i32,
email: String,
name: Option<String>,
});