Skip to main content

CodecEstimator

Trait CodecEstimator 

Source
pub trait CodecEstimator {
    // Required methods
    fn collect(&mut self, value: u64);
    fn estimate(&self) -> Option<u64>;
    fn serialize(&self, values: &[u64], writer: &mut dyn Write) -> Result<u64>;

    // Provided method
    fn finalize(&mut self) { ... }
}
Expand description

Estimates serialized size for a given codec.

Usage: call collect(val) for every value, then finalize(), then estimate() returns the byte count.

Required Methods§

Source

fn collect(&mut self, value: u64)

Source

fn estimate(&self) -> Option<u64>

Source

fn serialize(&self, values: &[u64], writer: &mut dyn Write) -> Result<u64>

Provided Methods§

Source

fn finalize(&mut self)

Implementors§