Struct hdrsample::serialization::Deserializer
source · pub struct Deserializer { /* private fields */ }
Expand description
Deserializer for all supported formats.
Since the serialization formats all include some magic bytes that allow reliable identification of the different formats, only one Deserializer implementation is needed.
Implementations§
source§impl Deserializer
impl Deserializer
sourcepub fn new() -> Deserializer
pub fn new() -> Deserializer
Create a new deserializer.
sourcepub fn deserialize<T: Counter, R: Read>(
&mut self,
reader: &mut R
) -> Result<Histogram<T>, DeserializeError>
pub fn deserialize<T: Counter, R: Read>(
&mut self,
reader: &mut R
) -> Result<Histogram<T>, DeserializeError>
Deserialize an encoded histogram from the provided reader.
Note that &[u8]
and Cursor
are convenient implementations of Read
if you have some
bytes already in slice or Vec
form.