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.