[][src]Trait serde_db::de::DeserializableRow

pub trait DeserializableRow: Sized {
    type E: From<DeserializationError> + Sized;
    type V: DbValue;
    fn len(&self) -> usize;
fn next(&mut self) -> Option<Self::V>;
fn number_of_fields(&self) -> usize;
fn fieldname(&self, field_idx: usize) -> Option<&str>; fn into_typed<'de, T>(self) -> Result<T, Self::E>
    where
        T: Deserialize<'de>
, { ... } }

A minimal interface for the Row type to support the deserialization.

Associated Types

type E: From<DeserializationError> + Sized

The error type used by the database driver.

type V: DbValue

The value type used by the database driver.

Loading content...

Required methods

fn len(&self) -> usize

Returns the current length of the row (which is decremented with each call to next()).

fn next(&mut self) -> Option<Self::V>

Removes and returns the next value.

fn number_of_fields(&self) -> usize

Returns the number of fields in a complete row.

fn fieldname(&self, field_idx: usize) -> Option<&str>

Returns the name of the column at the specified index.

Loading content...

Provided methods

fn into_typed<'de, T>(self) -> Result<T, Self::E> where
    T: Deserialize<'de>, 

Converts the row into a struct, a tuple, or (if applicable) into a plain rust value.

Errors

An error is produced if deserialization into the target type is not possible.

Loading content...

Implementors

Loading content...