asap_sketchlib 0.2.0

A high-performance sketching library for approximate stream processing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Native MessagePack codec impl for [`crate::sketches::ddsketch::DDSketch`].

use crate::message_pack_format::{Error, MessagePackCodec};
use crate::sketches::ddsketch::DDSketch;

impl MessagePackCodec for DDSketch {
    fn to_msgpack(&self) -> Result<Vec<u8>, Error> {
        Ok(self.serialize_to_bytes()?)
    }

    fn from_msgpack(bytes: &[u8]) -> Result<Self, Error> {
        Ok(Self::deserialize_from_bytes(bytes)?)
    }
}