pub trait IntoRowByTypes: Sized {
    type DatumIter<'a>: IntoIterator<Item = Datum<'a>>
       where Self: 'a;

    // Required method
    fn into_datum_iter<'a>(&'a self) -> Self::DatumIter<'a>;

    // Provided method
    fn into_row<'a>(&'a self, row_buf: &'a mut Row) -> &'a Row { ... }
}
Expand description

A helper trait to get references to Row based on type information that only manifests at runtime (typically originating from inferred schemas).

Required Associated Types§

source

type DatumIter<'a>: IntoIterator<Item = Datum<'a>> where Self: 'a

An iterator type for use in into_datum_iter.

Required Methods§

source

fn into_datum_iter<'a>(&'a self) -> Self::DatumIter<'a>

Obtains an iterator of datums out of an instance of Self, given a schema provided by types.

Implementations are free to place specific requirements on the given schema.

Provided Methods§

source

fn into_row<'a>(&'a self, row_buf: &'a mut Row) -> &'a Row

Obtains a reference to Row for an instance of Self, given a Row buffer and a schema provided by types.

Implementations are free to not use row_buf if a zero-copy implementation can be provided. If the Row buffer is used, then the reference returned is to it. Implementations are also free to place specific requirements on the given schema.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IntoRowByTypes for ()

§

type DatumIter<'a> = Empty<Datum<'a>>

Empty iterator for unit.

source§

fn into_row<'a>(&'a self, row_buf: &'a mut Row) -> &'a Row

Returns the Row buffer, which is assumed to be empty, without touching it.

This implementation panics if types other than Some(&[]) are provided. This is because unit values need to have an empty schema.

source§

fn into_datum_iter<'a>(&'a self) -> Self::DatumIter<'a>

Returns an empty iterator.

This implementation panics if types other than Some(&[]) are provided. This is because unit values need to have an empty schema.

source§

impl<'b, T: IntoRowByTypes> IntoRowByTypes for &'b T

§

type DatumIter<'a> = <T as IntoRowByTypes>::DatumIter<'a> where T: 'a, Self: 'a

source§

fn into_datum_iter<'a>(&'a self) -> Self::DatumIter<'a>

Implementors§

source§

impl IntoRowByTypes for Row

§

type DatumIter<'a> = DatumListIter<'a>