Trait fastfield_codecs::FastFieldCodecSerializer[][src]

pub trait FastFieldCodecSerializer {
    const NAME: &'static str;
    const ID: u8;

    fn is_applicable(
        fastfield_accessor: &impl FastFieldDataAccess,
        stats: FastFieldStats
    ) -> bool;
fn estimate(
        fastfield_accessor: &impl FastFieldDataAccess,
        stats: FastFieldStats
    ) -> f32;
fn serialize(
        write: &mut impl Write,
        fastfield_accessor: &impl FastFieldDataAccess,
        stats: FastFieldStats,
        data_iter: impl Iterator<Item = u64>,
        data_iter1: impl Iterator<Item = u64>
    ) -> Result<()>; }
Expand description

The FastFieldSerializerEstimate trait is required on all variants of fast field compressions, to decide which one to choose.

Associated Constants

A codex needs to provide a unique name and id, which is used for debugging and de/serialization.

Required methods

Check if the Codec is able to compress the data

Returns an estimate of the compression ratio. The baseline is uncompressed 64bit data.

It could make sense to also return a value representing computational complexity.

Serializes the data using the serializer into write. There are multiple iterators, in case the codec needs to read the data multiple times. The iterators should be preferred over using fastfield_accessor for performance reasons.

Implementors