Trait mz_repr::fixed_length::IntoRowByTypes
source · 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§
sourcetype DatumIter<'a>: IntoIterator<Item = Datum<'a>>
where
Self: 'a
type DatumIter<'a>: IntoIterator<Item = Datum<'a>> where Self: 'a
An iterator type for use in into_datum_iter
.
Required Methods§
sourcefn into_datum_iter<'a>(&'a self) -> Self::DatumIter<'a>
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§
sourcefn into_row<'a>(&'a self, row_buf: &'a mut Row) -> &'a Row
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§
Implementations on Foreign Types§
source§impl IntoRowByTypes for ()
impl IntoRowByTypes for ()
source§fn into_row<'a>(&'a self, row_buf: &'a mut Row) -> &'a Row
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>
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.