pub trait RecordsSerializerImpl<'a> {
    type Record;

    // Required methods
    fn record_length(record: &Self::Record) -> usize;
    fn serialize(data: &mut [u8], record: &Self::Record);
}
Expand description

An implementation of a records serializer.

RecordsSerializerImpl provides functions to serialize sequential records. It is required in order to construct a RecordsSerializer.

Required Associated Types§

source

type Record

The input type to this serializer.

This is the analogous serializing version of Record in RecordsImpl. Records serialization expects an Iterator of objects of type Record.

Required Methods§

source

fn record_length(record: &Self::Record) -> usize

Provides the serialized length of a record.

Returns the total length, in bytes, of record.

source

fn serialize(data: &mut [u8], record: &Self::Record)

Serializes record. into buffer data.

The provided data buffer will always be sized to the value returned by record_length.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, O> RecordsSerializerImpl<'a> for O
where O: OptionsSerializerImpl<'a>,