hdrhistogram::serialization

Trait Serializer

Source
pub trait Serializer {
    type SerializeError: Debug;

    // Required method
    fn serialize<T: Counter, W: Write>(
        &mut self,
        h: &Histogram<T>,
        writer: &mut W,
    ) -> Result<usize, Self::SerializeError>;
}
Expand description

Histogram serializer.

Different implementations serialize to different formats.

Required Associated Types§

Source

type SerializeError: Debug

Error type returned when serialization fails.

Required Methods§

Source

fn serialize<T: Counter, W: Write>( &mut self, h: &Histogram<T>, writer: &mut W, ) -> Result<usize, Self::SerializeError>

Serialize the histogram into the provided writer. Returns the number of bytes written, or an error.

Note that Vec<u8> is a reasonable Write implementation for simple usage.

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§