Skip to main content

Deserialisable

Trait Deserialisable 

Source
pub trait Deserialisable<T> {
    // Required methods
    fn ser_id(&self) -> u64;
    fn get_deserialised(self) -> Result<T, SerError>;
}
Expand description

A trait for values that can get deserialised themselves

Can be used for serialisers that reuse already allocated memory as the target, such as protocol buffers.

Required Methods§

Source

fn ser_id(&self) -> u64

The serialisation id for which this deserialiser is to be invoked

Source

fn get_deserialised(self) -> Result<T, SerError>

Try to deserialise this data into a T

Returns a SerError if unsuccessful.

Implementors§