pub fn deserialise<T>(data: &[u8]) -> Result<T, SerialisationError>
where
    T: Serialize + DeserializeOwned,
{
    let value = deserialize(data).map_err(|e| SerialisationError::Deserialise(*e))?;
    if serialized_size(&value) != data.len() as u64 {
        return Err(SerialisationError::DeserialiseExtraBytes);
    }
    Ok(value)
}
/// Deserialise a `Deserialize` type with no limit on the size of the serialised data.
Deserialise a `Deserialize` type with no limit on the size of the serialised data.
Deserialise a ` Deserialize ` type with no limit on the size of the serialised data .
pub fn deserialise<T>(data: &[u8]) -> Result<T, SerialisationError>
where
    T: Serialize + DeserializeOwned,
{
    let value = deserialize(data).map_err(|e| SerialisationError::Deserialise(*e))?;
    if serialized_size(&value) != data.len() as u64 {
        return Err(SerialisationError::DeserialiseExtraBytes);
    }
    Ok(value)
}
pub fn deserialise < T > ( data : & [ u8 ] ) -> Result < T , SerialisationError > where T : Serialize + DeserializeOwned , { let value = deserialize ( data ) . map_err ( | e | SerialisationError :: Deserialise ( * e ) ) ? ; if serialized_size ( & value ) != data . len ( ) as u64 { return Err ( SerialisationError :: DeserialiseExtraBytes ) ; } Ok ( value ) }
Deserialise a `Deserialize` type with no limit on the size of the serialised data.
Deserialise a ` Deserialize ` type with no limit on the size of the serialised data .
data
&[u8]
data
&[u8]