pub trait FromRow<R, E> {
    fn forward<'a, I>(iter: &mut I) -> Result<usize, E>
    where
        I: Iterator<Item = &'a Select>,
        Self: Sized
; fn from_row<'a, I>(
        row: &R,
        index: &mut usize,
        iter: &mut I
    ) -> Result<Option<Self>, E>
    where
        I: Iterator<Item = &'a Select> + Clone,
        Self: Sized
; }
Expand description

This is implemented by Toql Derive for all dervied structs with generic row and error. The implementation of primitive types with concrete row and error type must be done by the database crate.

Required Methods

Returns the number of selects This is needed to advance the iterator and the row index. The Deserializer needs this information to skip left joins that have fields selected but are null. Those left joins cause select information in the select stream that must be skipped.

Read row values into struct, starting from index. Advances iter and index Returns None for value unselected values or joined entities that have null keys. Return Error, if value is selected, but cannot be converted.

Implementations on Foreign Types

Implementors