ppp_packet::records

Trait RecordsSerializerImpl

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§