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§
Sourcefn get_deserialised(self) -> Result<T, SerError>
fn get_deserialised(self) -> Result<T, SerError>
Try to deserialise this data into a T
Returns a SerError if unsuccessful.